正则获取地址栏参数
getQueryString: function (name) {
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
var r = window.location.search.substr(1).match(reg);
if (r != null) {
return unescape(r[2]);
}
}
getQueryString: function (name) {
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
var r = window.location.search.substr(1).match(reg);
if (r != null) {
return unescape(r[2]);
}
}
本文标题:【JavaScript】常用功能
本文链接:https://www.haomeiwen.com/subject/qmsnlttx.html
网友评论