I was doing some cross browser testing on certain piece of functionality today, and ran across a rather nifty little gem.
In IE8: Out of memory at line: 99
In IE7: Out of memory at line: 100
In IE6: Stack overflow at line: 101
From what I've been able to dig up, most of the time these messages start appearing, it's an issue with having an array in which the number of elements is greater than 65,535
. However, I don't believe that that's the issue at hand here.
The functionality in question is an action from within an iframe
"closing" the current iframe
and "opening" another using jQuery. It's actually happening on the close/open interaction.
Has anyone seen anything like this before?
Edit: Upon further investigation, it doesn't actually seem to be related to the iframes. Still digging, but any suggestions would be appreciated.
So it turned out to be an issue with IE and everything else handling things differently...as usual.
I have a function that I'm using to throw an error, and it's recursive by design. I wanted the error to be displayed in the main Document, not an iframe (which are being used extensively on this site, unfortunately). The gist of my function is as follows:
myClass.myErrorFunc = function ( msg ) {
if ( parent !== window ) {
parent.myClass.myErrorFunc( msg );
} else {
// display the error
}
}
This works GREAT in Chrome and Firefox. It recurses one level and does the error displaying in the main window because once it gets to the top level, the parent is itself. Apparently in IE, however, window's parent is NEVER itself. Thus, infinite recursion.
Stay tuned for a solution.
Edit: Apparently, it was an issue with using !==
instead of !=
. When I switched it to !=
, the second time through (as this is being run from an iframe
), window == parent
evaluates true, but window === parent
does not...
Whatever, I'll take it...
Thanks for your help guys.
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