当前位置: 首页 > 图文教程 > 网络编程 > ASP > 通过地址栏传递参数.通过url传递参数

ASP
ASP编程中15个非常有用的例子 (二)
ASP与JSP的比较(一)
ASP与JSP的比较(二)
ASP中五种连接数据库的方法
从ASP调用SQL中的图像
用排序串字段实现树状结构(例程:连接字串)
用排序串字段实现树状结构(例程:删除贴子)
用排序串字段实现树状结构(例程:回复表单)
用排序串字段实现树状结构(例程:显示贴子内容)
用排序串字段实现树状结构(例程:显示树)
用排序串字段实现树状结构(存储过程)
用排序串字段实现树状结构(库结构)
用排序串字段实现树状结构(原理)
remote script文档(转载自微软)(一)
remote script文档(转载自微软)(二)
remote script文档(转载自微软)(三)
remote script文档(转载自微软)(四)
remote script文档(转载自微软)(五)
remote script文档(转载自微软)(六)
remote script文档(转载自微软)(七)

ASP 中的 通过地址栏传递参数.通过url传递参数


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 195 ::
收藏到网摘: n/a

  看看我的方法可以吗?应该可以了吧。(通过地址栏传递参数)(通过url传递参数)
<script language="Javascript">
var goUrl="index.asp?schooltype=&area=";
function getType(vl)
{var stno,arno,tmpurl;
stno=goUrl.indexOf("schooltype=");
arno=goUrl.indexOf("area=");
if (stno!=-1 && arno!=-1 & stno<arno)
{tmpurl=goUrl.substr(0,stno+11);
tmpurl=tmpurl+vl+goUrl.substr(arno-1);
goUrl=tmpurl;
}
}
function getArea(vl)
{var arno,tmpurl;
arno=goUrl.indexOf("area=");
tmpurl=goUrl.substr(0,arno+5);
goUrl=tmpurl+vl;
}
function goNext()
{//最好判断用户是否已经选择,可以用gourl的长度来判断
window.location=goUrl;
}
</script>

<td width=23% valign=top ><input ONCLICK='getType(1);' type=radio name=schooltype VALUE='1'> 小学</td>
<td valign=top ID=ID_177><br><input type=radio name=area ONCLICK='getArea(177);' ID=IDC_177 value='177'>福州市</td>
<td valign=top ID=ID_177><br><input type=radio name=area ONCLICK='goNext();' ID=IDC_177 value='177'>下一步</td>


可以根据你的选择江参数加到url 中。可以用来替代form 的提交。