Hi,
I'm attempting to dynamically remove an IFRAME using the DOM method "removeChild()". However, when I try doing this JavaScript throws the following error/expcetion:
On the following line(s):Code:Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMWindowInternal.alert]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://.../general.js :: deleteIframe :: line 183" data: no]
Even though javascript throws the exception the IFRAME does get removed, however, script execution completely stops after it (which is a big problem).Code:var doc = window.parent.document; var ifr = doc.getElementById('myIframe'); ifr.parentNode.removeChild(ifr);
What is causing the exception?
Can i catch the exception?
Is there any other way of removing an IFRAME dynamically?
(Running Mozilla Firefox 1.5.0.11)



Reply With Quote


Bookmarks