2012-09-28 77 views
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 

我怎样才能解决这个问题?

+1

http://stackoverflow.com/questions/2709612/using-object-create-instead-of-new这将帮助你...在某些浏览器中不支持Object.create() – Apurv

回答

0

根据MSDN

的Object.create:

支持在下面的文档模式:互联网浏览器9级的标准, 的Internet Explorer 10标准,和Internet Explorer 11个标准。在以下文档模式下不支持 :Quirks,Internet Explorer 6标准,Internet Explorer 7标准,Internet Explorer 8标准。

因此,当您使用IE9检查兼容模式,如果它设置为standardsQuirks

相关问题