[My initial posting didn't seem to make it, so here's retry]
I'm learning/experimenting with some simple JS/html markup, running
an apache daemon and mozilla firefox browser in RH 9.
Let's say I run the following markup with one or more of lines 6-10
commented out:
1 <html>
2 <head>
3 <script type="text/javascript">
4 function showinfo()
5 {
6 width = window.screen.availWidth;
7 document.write("<br>screen width=\n");
8 document.write(width);
9 document.write("<br>Date: ");
10 document.write(Date());
11 }
12 </script>
13 </head>
14 <body onload="showinfo()">
15 <p>
My question: is there a simple explanation to account for the 'unexpected'
behaviours below (Runs 1, 3, 5)?
Run 1: nothing in 6-10 commented out; output (expected more):
screen width=
Run 2: line 7 commented out; output (as expected):
1024
Date: Wed Apr 14 2004 20:55:58 GMT-0400 (EDT)
Run 3: lines 7, 9, 10 commented out; output (as expected, but unfinished loading):
1024
[ongoing hourglass indicating loading in progress]
Run 4: lines 7, 10 commented out; output (as expected):
1024
Run 5: lines 7-9 commented out; output (as expected, but unfished loading):
Date: Wed Apr 14 2004 22:46:49 GMT-0400 (EDT)
I'm sure I'm missing something obvious. Helpful comments would be much appreciated.
--Tony