I need to clear all the HTML code in JavaScript before I use some
parent.document.write(); statements. Is there a .clear or something method to erase all previous code?
Printable View
I need to clear all the HTML code in JavaScript before I use some
parent.document.write(); statements. Is there a .clear or something method to erase all previous code?
try :
parent.document.InnerHTML = ""
or maybe :
parent.document.body.InnerHTML = ""
:)
There is a document.clear() method that was part of JavaScript 1.0. I'm not sure if it's still supported in the current browsers though. It's worth a shot.
Chris
that sounds like what i need but it doesn't seem to do anything...