0
此代碼段是創建新的對象,它工作正常,在其他瀏覽器IE,但9SCRIPT438:對象不支持屬性或方法「創造」 - IE9
function Item(no, name, qty, lineNo) {¬
this.no = no;¬
this.name = name;¬
this.qty = qty;¬
this.lineNo = lineNo;¬
}¬
Item.prototype = Object.create(null);¬ // error this line
我怎樣才能解決這個問題?
http://stackoverflow.com/questions/2709612/using-object-create-instead-of-new這將幫助你...在某些瀏覽器中不支持Object.create() – Apurv