Lesson 1: USING
JAVA SCRIPT CODE
What
is JavaScript? JavaScript is a simple programming language which
is used to enhance the interactive features of web pages. It allows
you to add special effects, perform calculations, check forms, write
interactive games, create security passwords and more.
JavaScript
is not Java!
Java is coded in a similar fashion to C++ and is not considered an easy
language to learn for non-programmers. You don't need to know details
about how they differ.
JavaScript
code is directly embedded into HTML using the SCRIPT tag as shown below.
<SCRIPT> JavaScript statements... </SCRIPT>
The
optional LANGUAGE attribute can also be used to specify the scripting
language.
<SCRIPT LANGUAGE="JavaScript">
JavaScript statements...
</SCRIPT>
HTML
COMMENT TAGS
To prevent
old browsers from trying to read the code, and getting an error on the
page, we put it in HTML comment tags as in the example below:
<SCRIPT>
<!--// JavaScript statements...; //-->
</SCRIPT>