Basically I have a page that launched a fancybox iframe. In that iframe I also include jQuery. But when I testing it in Internet Explorer 9 it gives me the error
Line: 68\n Error: 'Object' is undefined`
This error is in file jquery-1.4.1.js
and the line in question is the second line of this:
// Save a reference to some core methods
toString = Object.prototype.toString,
hasOwnProperty = Object.prototype.hasOwnProperty,
push = Array.prototype.push,
slice = Array.prototype.slice,
indexOf = Array.prototype.indexOf;
which is the last lines of the var jQuery = function( selector, context ) {
.
No problem if I'm in compatibility view, no problem in any other browsers, just Internet Explorer 9 in Internet Explorer 9 mode and Internet Explorer 9 standards. If I ignore the error I see no problems using any version of jQuery.
What's up, and what I can do to fix?
The problem was fixed when I removed the SRC attribute from the iframe and I added onOpen event to jQuery's dialog:
open: function()
{
document.getElementById("mainFrame").src = "/login.aspx";
}
I had the EXACT same issue, but the cause of mine was different. I figured I'd share here in case others were in the same boat as me - especially given that it took me about 4 hours to track down...
Our main page had an iframe which ended up having its src attribute changed twice in a very short amount of time (we were actually loading the same src twice by accident - once directly in the HTML and then again on page load via JavaScript). I'm not sure why Internet Explorer 9 chokes, but I'm guessing that the frame was partially through initializing its scripts when the src was set again, putting the JavaScript engine into an unhappy state. Either way I'm glad I found it, since we shouldn't have been loading the frame twice!
However, the real reason why Internet Explorer 9 died so bad is a mystery.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With