为了账号安全,请及时绑定邮箱和手机立即绑定

getParam那个方法啥意思,没看懂

function getParam(paramName) {
    paramValue = "", isFound = !1;
    if (this.location.search.indexOf("?") == 0 && this.location.search.indexOf("=") > 1) {
        arrSource = unescape(this.location.search).substring(1, this.location.search.length).split("&"), i = 0;
        while (i < arrSource.length && !isFound) arrSource[i].indexOf("=") > 0 && arrSource[i].split("=")[0].toLowerCase() == paramName.toLowerCase() && (paramValue = arrSource[i].split("=")[1], isFound = !0), i++
    }
    return paramValue == "" && (paramValue = null), paramValue
}


正在回答

1 回答

根据入参paramName,从请求url中查找出与paramName名称匹配的请求参数的值。

比如:

假设请求的URL为“http://xxx/xxx?a=1&b=2&c=3

则getParam("a")的返回值为“1”


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

getParam那个方法啥意思,没看懂

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号