search PropertyString that specifies or receives the substring of the href propertylocation.search:The search property specifies a portion of the URL. This property applies to HTTP URLs only.
The search property contains variable and value pairs; each pair is separated by an ampersand. For example, two pairs in a search string could look as follows:?x=7&y=5 You can set the search property at any time, although it is safer to set the href property to change a location. If the search that you specify cannot be found in the current location, you get an error.______________________________________________________________________中文如: url=http://www.sohu.htm?i=1
location.search的值就是"?i=1"
substr(1) 就是从索引1开始截取
所以以这个页面为例的话location.search.substr(1)的值就是"i=1"