获取地址栏参数

_GetQueryString (paraName) {
let url = decodeURI(document.location.toString())
let arrObj = url.split('?')
if (arrObj.length > 1) {
let arrPara = arrObj[1].split('&')
let arr
for (let i = 0; i < arrPara.length; i++) {
arr = arrPara[i].split('=')
if (arr != null && arr[0] === paraName) {
return arr[1]
}
}
return ''
} else {
return ''
}
}
posted @ 2018-10-17 17:20  小淘气鬼--弟弟  阅读(155)  评论(0编辑  收藏  举报