标签:io ar for sp on cti bs amp new
-----------------------------js版本---------------------------------------
function Request(para) {
para = para.toLowerCase();
var url = document.URL;
var paraString = url.substring(url.indexOf("?") + 1, url.length).split("&");
var key, j;
for (i = 0; i < paraString.length; i++) {
j = paraString[i];
key = j.substring(0, j.indexOf("=")).toLowerCase();
if (key == para) {
return j.substring(j.indexOf("=") + 1, j.length);
}
}
return "";
}
-----------------------------jquery版本-----------------------------------
function GetQueryString(name)
{
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if(r!=null)return unescape(r[2]); return null;
}
// 调用方法
alert(GetQueryString("参数名1"));
标签:io ar for sp on cti bs amp new
原文地址:http://www.cnblogs.com/syj-student/p/4059373.html