日期:2014-05-16 浏览次数:20409 次
function GetQueryString(str){
var rs=new RegExp("(^|)" +str+ "=([^\&]*)(\&|$)","gi").exec(LocString),tmp;
if(tmp=rs)return
tmp[2];
return "没有这个参数";
}
function getQueryString(key) {
var regex_str = "^.+\\?.*?\\b"+ key +"=(.*?)(?:(?=&)
------解决方案--------------------
$
------解决方案--------------------
#)"
var regex = new RegExp(regex_str,"i");
var url = window.location.toString();
if(regex.test(url)) return RegExp.$1;
return null;
}
alert( getQueryString('cat_id') );
$(function () {
var str = "cat_id";
var LocString = "http://192.168.40.224/htmlargu/demo.html?log_id=111&cat_id=222&page=333";