var str="http://toutiao.com/yl.html?f=88&m=988"
var kv = function(key) {
var _key = new RegExp("[?&]" + key + "\=([^&#]+)", "g").exec(str);
if (_key) {
return _key[1]
};
}
console.log(kv ("m")) //988
清除cookie
//清除所有domain下的cookie
function removeCookies(key) {
$.removeCookie(key);
$.removeCookie(key, {
path: '/',
domain: 'baidu.com'
});
$.removeCookie(key, {path: '/'});
}
if($.cookie("q")){
removeCookies('q');
};