var QueryString1,QueryString2,QueryString3;
tempstr="";
str = window.location.href;
pos = str.indexOf("?")
parastr = str.substring(pos+1);
if (str.indexOf("&")>0)
{
para = parastr.split("&");
for(i=0;i<para.length;i++)
{
tempstr1 = para[i];
pos = tempstr1.indexOf("=");
if(tempstr1.substring(0,pos) == "QueryString1")
QueryString1 = tempstr1.substring(pos+1);
if(tempstr1.substring(0,pos) == "QueryString2")
QueryString2 = tempstr1.substring(pos+1);
if(tempstr1.substring(0,pos) == "QueryString3")
QueryString3 = tempstr1.substring(pos+1);
}
}
本文引用通告地址: http://blog.youkuaiyun.com/crazythief/services/trackbacks/172022.aspx
[ 点击此处收藏本文]
这段博客内容是一段JavaScript脚本,用于解析URL中的参数。通过获取当前页面的URL,提取出参数部分,再根据“&”分割参数,最后根据参数名提取对应的值,如QueryString1、QueryString2、QueryString3等。
4604

被折叠的 条评论
为什么被折叠?



