How do clear the iframe in netscape 7.0 and Internet explorer. The following code works in IE but not in netscape <html> <head> <title>Simple Math Practice</title> <script language="javascript" type="text/javascript"> <!-- Hide Script function RandPosInt() { Rnum = Math.round(Math.random()*8+1); return Rnum; } function WriteHeader() { problem.document.write('<html><head><link href="math.css" rel="stylesheet" type="text/css"><\/head><body>'); } function WriteContent() { problem.document.write("this is content"); } function WriteFooter() { problem.document.write("<\/body><\/html>"); } function ClearFrame() { problem.document.open(); problem.document.clear(); } function CloseFrame() { problem.document.close(); } // End Hiding Script --> </script> <link href="math.css" rel="stylesheet" type="text/css"> </head> <body> <div align="center"> <h1>Simple Math Practice</h1> <iframe src="defaultframe.html" id="problem" name="problem" frameborder="1" marginwidth="10" marginheight="10" scrolling="no" align="top" height="200" width="500"> </iframe> <script language="javascript" type="text/javascript"> <!-- Hide Script //FirstNum = RandPosInt(); //problem.document.write("Test1"); ClearFrame(); WriteHeader(); WriteContent(); WriteFooter(); CloseFrame(); // End Hiding Script --> </script> </div> </body> </html>
That function is no longer supported. See here: http://www.web-developer-india.com/web/jscript/refp_77.html