javascript fn.init 原型链练习

;(function(window,document){
    var Constant=function()
    {
        return Constant.fn.init();
    };
    Constant.fn=Constant.prototype={
        url:  'http://url',
         dataUrl:'http://192.168.18.210/',
        sessionKey: '',
        param : '',
        clientType: 'PC',
        init: function(){
            this.sessionKey="";
            this.param={'clientType': 'PC','sessionKey':this.sessionKey};
            return this;
        }
    };
    Constant.fn.init.prototype=Constant.fn;
    window.constant=Constant;
})(window,document);

 

posted @ 2016-09-24 15:22  大赚佬  阅读(279)  评论(0编辑  收藏  举报