javascript - Why don't some objects have a constructor in IE? -


The javascript code below has a different effect in different browsers:

  document.write (This.location.constructor); Document.write ("& lt; br / & gt;"); Document.write (this.constructor); Document.write ("& lt; br / & gt;"); In Chrome, in the page:  
  function location () {[native code}} function DOMWindow () {[native code]}  

code> < / Pre>

In Firefox, in the page:

  [object location] [object window]  

In IE8, the page is:

I do not understand why the two objects constructor in IE are undefined if their constructors are undefined, what about their prototype? Are they also undefined ?

Using it IE8 debugging console, I have no problem using the code you provided .

My results ...

  [object location] [object window]  

Are you sure that nothing else generates Is this to fail?


Comments