问答详情
源自:4-6 商品模型模型--商品详情页面

getParam(paramName)

getParam(paramName)方法是怎么写的

提问者:精慕门4134495 2018-12-13 21:51

个回答

  • 幼儿园很贵的
    2018-12-14 02:07:44
    已采纳

    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		}


  • Mr_larm
    2019-02-20 22:36:58

    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

  • 幼儿园很贵的
    2018-12-14 02:06:39

    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