HTML页面如何象asp一样接受参数 选择自 qxg1123 的 Blog
2005-09-08 06:51
525 查看
<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>
作者Blog:http://blog.csdn.net/qxg1123/
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>
作者Blog:http://blog.csdn.net/qxg1123/
相关文章推荐
- HTML页面如何象ASP一样接受参数
- HTML页面如何象asp一样接受参数
- HTML页面如何象ASP一样接受参数
- HTML页面如何象asp一样接受参数
- 使HTM页面像ASP页面一样接受参数!
- HTML页面一样可以接受参数(藏)
- 使HTM页面像ASP页面一样接受参数!
- 使HTM页面像ASP页面一样接受参数!
- 从JSP前台页面传中文参数,到后台接受出现乱码,如何解决?
- 如何在一个页面中动态放置多个Droppable来接受不同的Draggable?(accept参数的用法)
- hTML 如何在不同页面上传递参数( 1 )
- .net页面间的参数传递简单实例 选择自 JavaProgramers 的 Blog
- HTML控件ID和NAME属性的区别,以及如何在asp.net页面的.CS文件中获得.ASPX页面中HTML控件的值
- HTML控件ID和NAME属性的区别,以及如何在asp.net页面的.CS文件中获得.ASPX页面中HTML控件的值
- js 如何像asp.net 一样得到参数
- ASP.NET 2.0页面框架的几处变化 选择自 liuhm 的 Blog
- [代码]HTML页面如何接收外部参数
- 如何在一个页面中动态放置多个Droppable来接受不同的Draggable?(accept参数的用法)
- 如何在Silverlight应用程序中获取ASP.NET页面参数
- 不同web如何通讯之 html页面获取传递的参数