0

This code snippet is to create new object, it works fine on other browsers but 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

How can I fix this ?

Dzung Nguyen
  • 9,152
  • 14
  • 65
  • 104
  • 1
    http://stackoverflow.com/questions/2709612/using-object-create-instead-of-new this will help you.... Object.create() is not supported in some of thw browsers – Apurv Sep 28 '12 at 09:32

1 Answers1

0

According to MSDN

Object.create:

Supported in the following document modes: Internet Explorer 9 standards, Internet Explorer 10 standards, and Internet Explorer 11 standards. Not supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards.

So as you using IE9 check the compatibility mode if it is set to standards or Quirks.

Saif
  • 6,804
  • 8
  • 40
  • 61