In the world of computer programming languages you will examine that the first
example of coding comes in just print the " Hello World " on screen and we also
follow this tradition and write our first JavaScript showing the Hello World on
our monitor screen. It is the beginning of this JavaScript Tutorial. We
will take a little bit of burden over here by just playing to print our messages
on our monitor screen.
On the above simplest JavaScript code we can see that how to use JavaScript into an
HTML page, we use the
<script> tag with its attribute type for defining scripting language.
Now, the
<script type="text/javascript"> and
</script> tells where the
JavaScript starts and ends on our web page and in between we can place our
JavaScript keywords and use any programming logic...
The out put of the above will also be same like the first example's out
put. Next we added an optional
HTML comment that surrounds our JavaScript
code. If a browser does not support JavaScript, then it will not display our
code in plain text to the user as out put. The
HTML comments stars with
"<!--"
and comment was ended with a
"-->". This is proffered to use always write your
JavaScript in
HTML comments.
There are so many different things that can go wrong with a JavaScript, it would be human error, browser
compatibility issues, or operating system
differences, or some non-supportive functions of JavaScript at that plate form. So whenever using
JavaScript, be sure that you test your
JavaScript out on a wide variety of systems and most importantly, different
web browsers such as Firefox, Internet Explorer, Netscape etc.