var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg); //获取url中"?"符后的字符串并正则匹配
var context = "";
if (r != null)
context = r[2];
reg = null;
r = null;
return context == null || context == "" || context == "undefined" ? "" : context;
}
$('.TK_serTxt').attr('value',GetQueryString("q"));
取得q的参数,并赋值给class为TK_serTxt的value
版权声明:本文为博主原创文章,未经博主允许不得转载。