找到了一个,先看看
<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>
<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>
解决方案 »
- treeview 问题,请教大家
- RegularExpressionValidator 这个验证 只能是数字的才能输入 不允许有汉字或者字符输入。应该怎么写呢?
- 在SQL语句的Like子句中遇到特殊字符怎么办?
- 请教,在使用对象属性或方法时系统给出的中文提示的问题。
- 不能远程地将虚拟目录转换为子站点……
- 如何发送文件到网络打印机,并打印(使用C#)?(非常急)
- WEB站点高级编程中的程序集的[assembly: AssemblyKeyFile(@"\Wrox\Keys\ThePhile.snk")],这是不是相对项目文件的相当路径
- 急!!(在线等待)
- EasyUI ComboBox的问题
- web.config配置实现去后缀
- 请问,架构,构件,组件之间的区别?(在线等,马上结帖)
- 急!!!如何左边选省, 右边显示相应的市的省市象listview?要求:弹出窗口选择市后确定,结果显示在父窗口的textbox中
所以,至少在目前,纯html,xml(不含任何其他脚本和程序)是不能接受参数的。因为这些格式的文件仅仅是用来存储信息和现实信息,本身根本不是编程语言,没有逻辑判断能力,如果接受了参数怎么办?
如果你用exchange server就知道了