window.location.search.substr(一).split(\"&\")代表什么意思
2016-10-17 17:09
441 查看
window.location.search.substr(1).split(\”&\”)代表什么意思
window.location
window的location对象
search
得到的是url中query部分
substr()
返回一个从指定位置开始的指定长度的子字符串
这里设置为1,是为了把url中的?号去掉
split()
将一个字符串分割为子字符串,然后将结果作为字符串数组返回
这里就是把query部分以&为分割符,分割
测试:把下面代码保存为1.htm
注意是1.htm
window.location
window的location对象
search
得到的是url中query部分
substr()
返回一个从指定位置开始的指定长度的子字符串
这里设置为1,是为了把url中的?号去掉
split()
将一个字符串分割为子字符串,然后将结果作为字符串数组返回
这里就是把query部分以&为分割符,分割
测试:把下面代码保存为1.htm
注意是1.htm
<script language="javascript"> alert(window.location.search.substr(1).split("&")) </script> <a href="1.htm?topic=1&id=2">测试</a>
相关文章推荐
- window.location.search.substring(1); 什么意思???
- var djConfig = { isDebug: (window.location.search.indexOf("debug")>-1) };
- js 中的window.location.search.match("XX")
- "宕机"代表什么意思
- split("\\s"{1,})里面的正则表示什么意思
- window.location.search.substring(1); 什么意思
- window.location.search是什么意思
- window.location.search.substring(1); 什么意思
- window.location.search.substring(1); 什么意思
- replace(//s/g,"")中的/g是什么意思? 及replace函数的用法
- media="screen" 这句代码是什么意思?
- 关于js中"window.location.href"、"location.href"、"parent.location.href"、"top.location.href"的用法
- 关于js中"window.location.href"、"location.href"、"parent.location.href"、"top.location.href"的用法
- vPro这个"v"字代表什么意思
- Page.ClientScript.RegisterStartupScript(this.GetType(), "","")引号里面具体代表什么?
- c++中的#include "stdafx.h"是什么意思?
- [Browsable( true ) , Description( "当前页记录数" ) , Category( "分页" ) , DefaultValue( 0 )]//这一行是什么意思
- VB里"On Error Resume Next"是什么意思?
- window.location="";和location.replace("");区别
- css样式中的"继承性"是什么意思?