使HTM页面像ASP页面一样接受参数!
2007-09-17 17:08
295 查看
<script language="JavaScript">
var pos,str,para,parastr,tempstr1;
tempstr="";
str = window.location.href;
pos = str.indexOf("?")
parastr = str.substring(pos+1);
document.write("<br>文件路径:"+str);
if (pos>0){
document.write("<br>所有参数:"+parastr);
}
else
{
document.write ("无参数");
}
if (str.indexOf("&")>0){
para = parastr.split("&");
for(i=0;i<para.length;i++)
{
tempstr1 = para[i];
pos = tempstr1.indexOf("=");
//document.write (tempstr1.substring(0,pos));
document.write ("<br>参数"+i+":"+tempstr1.substring(0,pos));
document.write ("等于:"+tempstr1.substring(pos+1));
}
}
</script>
var pos,str,para,parastr,tempstr1;
tempstr="";
str = window.location.href;
pos = str.indexOf("?")
parastr = str.substring(pos+1);
document.write("<br>文件路径:"+str);
if (pos>0){
document.write("<br>所有参数:"+parastr);
}
else
{
document.write ("无参数");
}
if (str.indexOf("&")>0){
para = parastr.split("&");
for(i=0;i<para.length;i++)
{
tempstr1 = para[i];
pos = tempstr1.indexOf("=");
//document.write (tempstr1.substring(0,pos));
document.write ("<br>参数"+i+":"+tempstr1.substring(0,pos));
document.write ("等于:"+tempstr1.substring(pos+1));
}
}
</script>
相关文章推荐
- 使HTM页面像ASP页面一样接受参数!
- 使HTM页面像ASP页面一样接受参数!
- HTML页面如何象asp一样接受参数 选择自 qxg1123 的 Blog
- HTML页面如何象ASP一样接受参数
- HTML页面如何象ASP一样接受参数
- HTML页面如何象asp一样接受参数
- HTML页面如何象asp一样接受参数
- HTML页面一样可以接受参数(藏)
- Asp.net页面之间传递参数的几种方法
- asp.net获取当前页面文件名,参数,域名等方法。统一session验证和权限验证的方法
- 利用UrlRewrite,asp.net动态生成htm页面
- Asp.net页面之间传“大量的参数”
- Asp.net页面间的参数传递简单实例
- Asp.net页面之间传递参数的几种方法
- ASP.NET 页面间传递参数的方法
- Asp.net页面之间传递参数的几种方法
- Use Response.Filter来简体繁体转换 静态页生成. 利用UrlRewrite,asp.net动态生成htm页面
- C# asp.net页面通过URL参数传值中文乱码问题解决办法
- 在asp.net页面中传递中文参数
- asp.net 参数不同共用一个页面的实现方法