繁体中文
设为首页
加入收藏
当前位置:在线教程首页 >> 程序设计 >> ASP >> 进阶篇 >> HTML页面如何象asp一样接受参数

HTML页面如何象asp一样接受参数

2004-09-16 08:12:00  作者:佚名  来源:互联网  浏览次数:154  文字大小:【】【】【
关键字: 教程
 

<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>

此文章不能满足您的需求?那就就Google一下吧:)
Google
 

责任编辑:admin


相关文章
 

最新文章

更多

· 浅谈ASP中Web页面间的数...
· 如何实现无刷新的Dropdo...
· 利用adodb.stream直接下...
· 用ASP编程控制在IIS建立...
· 如何在pb中创建COM组件,...
· HTML页面如何象asp一样接...
· 把文章内容中涉及到的图...
· 使用组件封装数据库操作(二)
· 使用组件封装数据库操作(一)
· IIS6.0下ASP的新增功能

推荐文章

更多

· 浅谈ASP中Web页面间的数...
· 如何实现无刷新的Dropdo...
· 利用adodb.stream直接下...
· 用ASP编程控制在IIS建立...
· 如何在pb中创建COM组件,...
· HTML页面如何象asp一样接...
· 把文章内容中涉及到的图...
· 使用组件封装数据库操作(二)
· 使用组件封装数据库操作(一)
· IIS6.0下ASP的新增功能

热点文章

更多