首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > CSS >

html中取得链接中的参数

2012-08-02 
html中获得链接中的参数html xmlnshttp://www.w3.org/1999/xhtmlmeta http-equivContent-Type co

html中获得链接中的参数

<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

 

 <script language="JScript">
<!--
var LocString=String(window.document.location.href);
function GetQueryString(str){
var rs=new RegExp("(^|)"+str+"=([^&]*)(&|$)","gi").exec(LocString),tmp;
if(tmp=rs)return tmp[2];
return "没有这个参数";
}
var mac=GetQueryString("mac");
var ip=GetQueryString("ip");
var uid=GetQueryString("uid");

alert("mac地址为:"+mac);

alert("ip为:"+ip);

alert("uid为:"+uid);

//发送异步请求,没有返回结果
$.ajax({
type : "post",
url : "/vv.zz?type=94&mac="+mac+"&uid="+uid+"&ip="+ip,
data : null,
async : false
});
-->
</script>

</head>

<body>
页面显示

</body>
</html>

 

访问此页面时,显示页面并获得链接中的参数往后台发送请求

热点排行