Hiya
I’m making my first forays into Javascript – the following code just writes some example code to a page.
The problem is that after the data has been written to the page, the “Loading” whirligig is still whirring around (Netscape 7). I would expect it to stop, or say “Done”, or something.
Presumably I’m doing something fundamentally wrong – but what?
[CODE]
<html>
<head>
<title> Java Script won’t stop loading example</title>
<meta name=”generator” content=”Namo WebEditor v6.0(Trial)”>
<script type=”text/javascript”>
function MyFunc(f){
document.open(“text/html”);
document.writeln(‘<html>’);
document.writeln(‘<head>’);
document.writeln(‘<title>JavaScript Page</title>’);
document.writeln(‘</head>’);
document.writeln(‘<body>’);
// loop through the array
for(var n=0;n <= 5;n++){
document.writeln(‘Line Number ‘ + (n) + ‘<br>’);
} //next
document.writeln(‘End of page’);
document.writeln(‘</body>’);
document.writeln(‘</HTML>’);
document.close;
} //end of function
</script>
</head>
<body>
<input type=”button” value=”Muttley! Do something!” onclick=”MyFunc(this.form);”>
</form>
<p> </p>
</body>
</html>
TIA
Joolz