phb5000
04-10-2007, 01:57 PM
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:
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]
On the following line(s):
var doc = window.parent.document;
var ifr = doc.getElementById('myIframe');
ifr.parentNode.removeChild(ifr);
Even though javascript throws the exception the IFRAME does get removed, however, script execution completely stops after it (which is a big problem).
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)
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:
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]
On the following line(s):
var doc = window.parent.document;
var ifr = doc.getElementById('myIframe');
ifr.parentNode.removeChild(ifr);
Even though javascript throws the exception the IFRAME does get removed, however, script execution completely stops after it (which is a big problem).
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)