function test(str){ this.name = str; this.number; this.setNum();//這行出事 this.setNum = function(){ this.number = 1; } } //直接執行 var t = new test("a"); // 然後就卡在this.setNum了 //假設我把this.setNum() 這段拿掉 var t = new test("a"); t.setNum(); // 正常執行:t.number = 1
歡迎光臨 jsGears.com 技術論壇 - AJAX, JavaScript, jQuery, 網站開發, 前端效能優化 (http://www.jsgears.com/) |