标签:search UNC substr nes ret fun mat amp jquer
function getUrlParam(name){
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
var r = window.location.search.substr(1).match(reg); //匹配目标参数
if (r!=null) return unescape(r[2]); return null; //返回参数值
}
getUrlParam(‘cid‘);
(function($){
$.getUrlParam = function(name) {
var reg = new RegExp("(^|&)"+
name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r!=null) return unescape(r[2]); return null;
}
})(jQuery);
$.getUrlParam(‘cid‘);
标签:search UNC substr nes ret fun mat amp jquer
原文地址:https://www.cnblogs.com/thatme/p/10208265.html