账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    移动端Window.prototype后调用不到
    44
    0

    我在init.js中
    Window.prototype.interface = function(){

    return 'https://xxx.xxxxxxx.com'

    }
    //
    Window.prototype.getParam=function(paramName){

    var paramValue = "", isFound = !1;
    if (this.location.search.indexOf("?") == 0 && this.location.search.indexOf("=") > 1) {
        var 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

    }
    给写了两个方法
    但是引入init.js以后
    页面window.getParam就可以取到值
    window.interface就是undefined
    请问是什么原因啊

    Window.prototype.publicMethod={

    interface:'',
    getParam:function(){}

    }

    也一样
    请大神解答

    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 别吃我 普通会员 1楼
      502 Bad Gateway

      502 Bad Gateway


      nginx
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部