getQueryString(url: string, name: string) {
const reg = new RegExp('(^|\\?|&)' + name + '=([^&]*)(\\s|&|$)', 'i');
if (reg.test(url)) return unescape(RegExp.$2.replace(/\+/g, ' '));
return '';
}
getQueryString(url: string, name: string) {
const reg = new RegExp('(^|\\?|&)' + name + '=([^&]*)(\\s|&|$)', 'i');
if (reg.test(url)) return unescape(RegExp.$2.replace(/\+/g, ' '));
return '';
}
本文标题:截取url中想要的参数
本文链接:https://www.haomeiwen.com/subject/upjqjktx.html
网友评论