0

このコード スニペットは、新しいオブジェクトを作成するためのものです。IE 9 以外の他のブラウザーでも問題なく動作します。

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

どうすればこれを修正できますか?

4

1 に答える 1

0

MSDNによると

Object.create:

次のドキュメント モードでサポートされています: Internet Explorer 9 標準、Internet Explorer 10 標準、および Internet Explorer 11 標準。次のドキュメント モードではサポートされていません: Quirks、Internet Explorer 6 標準、Internet Explorer 7 標準、Internet Explorer 8 標準。

したがってIE9、互換モードを使用するときに、standardsまたはに設定されているかどうかを確認してくださいQuirks

于 2015-02-01T07:33:39.687 に答える