P
Patrick
Hi
I am in the process of learning javascript.How come i am being told to
always finish my lines with a semicolon and when i try the 2 following
pieces of code they give the same output which is printing "Hello
world!" to the document.
The second example doesn't have the semicolon, why doesn't the browser
throw an error message?
<SCRIPT TYPE="text/javascript">
document.write("Hello world!"); //Semicolon present
</SCRIPT>
<SCRIPT TYPE="text/javascript">
document.write("Hello world!") //Semicolon missing
</SCRIPT>
Thanks to all
Patrick
(Please answer here or email (e-mail address removed) and remove
NOSPAM.I don't read the address used to post.)
I am in the process of learning javascript.How come i am being told to
always finish my lines with a semicolon and when i try the 2 following
pieces of code they give the same output which is printing "Hello
world!" to the document.
The second example doesn't have the semicolon, why doesn't the browser
throw an error message?
<SCRIPT TYPE="text/javascript">
document.write("Hello world!"); //Semicolon present
</SCRIPT>
<SCRIPT TYPE="text/javascript">
document.write("Hello world!") //Semicolon missing
</SCRIPT>
Thanks to all
Patrick
(Please answer here or email (e-mail address removed) and remove
NOSPAM.I don't read the address used to post.)