Wednesday, March 9, 2011

Empty Contents of an IFrame - Javascript

Following is one effective way that can help one to empty the contents of an iFrame.

window.frames['iFrameID'].location.href="about:blank";

Following are a few other methods that might work,

window.frames[['iFrameID'].location.href=" ";

window.frames[['iFrameID'].location.reload();
window.frames[['iFrameID'].document.close();
window.frames[['iFrameID'].document.body.innerHtml="";

hope this helps :)

No comments:

Post a Comment