anywhere inside the <html> tags of your page. The beginning
of your code begins with <script> and ends with </script>
<head><title>This is an example page</title></head>
document.write("Hi there. This text is written using
As you can see, we began our script with the
The part in orange is purely optional, but you should include
now. The second and next to last lines of the above example
are <!-- and //-->,
which are the comment tags. These tags should ALWAYS be included
to help hide your code against older browsers of both Netscape
and IE. If you don't include them, and someone is using an
old browser, the browser will just "dump" all your
code as text onto the screen, in other words, not a pretty
sight! The only "functional part" of this script
is the document.write(".......")
part. It basically writes to
the page whatever you put inside the quotation marks. Don't
worry so much about why this is so yet, we will discuss this
in detail later. We end this entire code with </script>
This terminates your script, and brings you back to html.
Like html, you can insert
the browser, and only used as reminder or documentation for
your code. To basic syntax of inserting comments is either:
for single-lined comments,
for multiple ones.
//this script does nothing and is useless!
/*Hay, don't involve me
Ok, we are now ready to
proceed to some real programming!
programming languages, relies on objects, functions, and event
handlers to create workable programs. If you know absolutely
nothing about these technical terms and how to use
them, don't worry. By the time we're through with this tutorial,