1.壓縮前的js(function () { var Test = function (name, age) { this.name=name; this.age=age; } Test.prototype={ getName:function () { return this.name + ' haha'; } } var testA = new Test('xiao',12) // 這里獲取得到 Test對(duì)象 console.log(testA.getName());})()2.壓縮后的js!function(){var e=function(e,n){this.name=e,this.age=n};e.prototype={getName:function(){return this.name+" haha"}};var n=new e("xiao",12);console.log(n.getName())}();3.在html中引入壓縮后的js后,var testA = new Test('xiao', 12) // 這里找不到 Test對(duì)象 console.log(testA.getName());請(qǐng)問一下,js代碼壓縮前要怎么改寫才能解決這個(gè)問題?
js壓縮混淆后,其他文件怎么引用相關(guān)方法
德瑪西亞99
2018-12-12 14:18:24