2012年4月12日

m与s修饰符

摘要: php正则中,m修饰符主要是改变"^"、"$"的匹配范围,加m后可匹配换行符\n,不加则不能s修饰符主要改变"."的匹配范围,加s后可匹配换行符\n,不加则不能详细见http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php 阅读全文

posted @ 2012-04-12 17:12 argb 阅读(285) 评论(0) 推荐(0) 编辑

2012年4月1日

javascript 随笔--类型

摘要: 4.3.19Number valueprimitive value corresponding to a double-precision 64-bit binary format IEEE 754 valueNOTE A Number value is a member of the Number type and is a direct representation of a number.4.3.20Number typeset of all possible Number values including the special ―Not-a-Number‖ (NaN) values, 阅读全文

posted @ 2012-04-01 11:28 argb 阅读(185) 评论(0) 推荐(0) 编辑

2012年3月27日

检查用户输入的一段代码

摘要: //检查用户输入,不符合规则不允许提交查询---bywangguan2012-03-26functioncheckInput(){varinput=document.getElementById('userlist');if(!input){returnfalse;}varuserlist=input.value,p=/^(?:[\u4E00-\u9FA5\w]+(?:,[\u4E00-\u9FA5\w]+)*)?$/g,//必须是以英文逗号分割的用户名,默认为用户名为字母数字下划线或中文,首尾不能为任何特殊符号m='';if((m=p.exec(userlis 阅读全文

posted @ 2012-03-27 11:56 argb 阅读(203) 评论(0) 推荐(0) 编辑

2012年3月22日

php 随笔

摘要: html实体分为alpha entities(named entities)和numeric entities,php函数htmlspecialchars、htmlentities都只能转化为alpha entities,如果要转化为numeric entities要使用mb_encode_numericentity函数,如转化为GBK编码的numeric entities:$str="(王贯)'<";$convmap=array(0x0,0xffff,0,0xffff);$str=mb_encode_numericentity($str, $convmap, 阅读全文

posted @ 2012-03-22 12:55 argb 阅读(289) 评论(0) 推荐(0) 编辑

2011年12月7日

about selection and range

摘要: The fundamental difference is that aSelectionrepresents the user's selection, whileRangerepresents a continuous part of a documentindependently of any visual representation. ASelectioncan (almost) be expressed in terms of zero, one or moreRanges but Ranges can also be created and modified comple 阅读全文

posted @ 2011-12-07 15:40 argb 阅读(242) 评论(0) 推荐(0) 编辑

2011年11月26日

range and selection

摘要: 1、通过document.createRange方法创建的Range无法正确执行createContextualFragment,需要document.getSelection().getRangeAt(0).createContextualFragment这样才行;2、document.createRange得到的range也无法直接insertNode进去一个documentFragment;比如f=range.createContextualFragment('<div>的解放路</div>');range.isertNode(f)会报错;3、se 阅读全文

posted @ 2011-11-26 19:14 argb 阅读(219) 评论(0) 推荐(0) 编辑

2011年11月20日

ECMAScript 5 与 ECMAScript 3 的一个小区别

摘要: In ECMAScript 5 (and some ECMAScript 3 implementations), reserved words may beused as property names without quoting. In general, however, property names that arereserved words must be quoted in ECMAScript 3. In ECMAScript 5, a trailing commafollowing the last property in an object literal is ignore 阅读全文

posted @ 2011-11-20 23:23 argb 阅读(1533) 评论(0) 推荐(0) 编辑

2011年11月11日

End-to-end and Hop-by-hop Headers-----from HTTP1.1

摘要: 13.5.1 End-to-end and Hop-by-hop HeadersFor the purpose of defining the behavior of caches and non-caching proxies, we divide HTTP headers into twocategories:· End-to-end headers, which are transmitted to the ultimate recipient of a request or response. End-to-endheaders in responses MUST be st 阅读全文

posted @ 2011-11-11 15:17 argb 阅读(423) 评论(0) 推荐(0) 编辑

2011年8月24日

Javscript the definitive guide 6th edition 阅读随记

摘要: 6.2.1 Objects As Associative ArraysWhen you use the . operator to accessa property of an object, however, the name of the property is expressed as an identifier.Identifiers must be typed literally into your JavaScript program; they are not a datatype,so they cannot be manipulated by the program.On t 阅读全文

posted @ 2011-08-24 11:03 argb 阅读(193) 评论(0) 推荐(0) 编辑

2011年7月29日

图片onload事件触发问题

摘要: 当页面上存在一个图片元素时如:<img src='xxxx' alt="" />,页面加载中ie7、8跟chrome下图片的onload事件非常奇怪,有后完全不触发,有时候触发后进行改变某些元素的操作,操作结果无效。并且随页面大小的不同情况时好时坏,甚至代码位置的不同而不同。火狐下一切正常。解决办法是再onload触发前改变图片src的值,也就是相当于图片开始时有个临时的占位图片,页面载入过程中用js换成实际需要的src,只要每次onload事件触发前src发生变化,则onload表现正常。 阅读全文

posted @ 2011-07-29 17:19 argb 阅读(522) 评论(0) 推荐(0) 编辑

导航