在ie6中,以下表达式返回true,这是不正确的,需要多加注意。
页面重定向与url中的hash在不同的浏览器中的表现
Posted on
|
In
web
访问时url上带有hash(如http://localhost/a.php#test),重定向到b.php页面时,当前a.php页上hash会被带到b.php页面上,在firefox/opera上测试的效果是如此,但ie6上则直接到b.php页,不会将a.php页上hash值带过来。示例代码:
a.php
difference of string.match and regexp.exec
Posted on
|
In
javascript
The match() method is the most general of the String regular-expression methods. It takes a regular expression as its only argument (or converts its argument to a regular expression by passing it to the RegExp() constructor) and returns an array that contains the results of the match. If the regular expression has the g flag set, the method returns an array of all matches that appear in the string. For example:
rails module include way
Posted on
|
In
ruby
以下方式的代码在rails中源码中的相当多见,其中的self.included(base)方法是一个回调方法,当此module被其他名为base的module (或者class) included的时候触发此方法。通过class_eval,include,extend加入了实例方法和类方法到base中,代码划分得很干净。
trap of in_array in php
Posted on
|
In
php