|
The
Story of
JavaScript
If you have a Web site
that you'd like to make more interactive, you have a
variety of scripting resources. For example, there's CGI,
Java applets, Dynamic HTML,
Perl, and VRML-all of
which require a major commitment to learn. But if you're
comfortable with HTML, the next logical step for
increasing your Web development skills may well be
JavaScript.
What is JavaScript?
JavaScript is a scripting language developed by Netscape
to add interactive features to Web documents. With
JavaScript you can perform calculations, check forms,
write interactive games, customize graphics selections,
capture events (such as mouse clicks or keystrokes),
create security passwords, mouse rollovers, form
validation, live clocks, and rollover effects, as well
as include other special effects.
So what's the
difference between Java and JavaScript?
Java is a
compiled programming language, similar to C or C++. It's
powerful enough to write major applications such as a
Web browser or small applications called
"applets" that perform just a few functions
and which you can insert into a Web page. Java also
requires considerable effort to master.
JavaScript is based on
the Java programming language, but it differs from true
programming languages in several ways. First, JavaScript
is much simpler than a genuine programming language, so
it's relatively easy to learn. In fact, JavaScript is
more on the scale of HTML than a true programming
language such as Java. JavaScript requires no compiling
(a process of translating computer code into an
executable form). JavaScript is embedded within the HTML
of a Web page and executed by the browser, so it
requires no additional files (such as an applet .class
file) to perform its functions.
JavaScript runs on
Netscape Navigator 2.x, 3.x, and 4.x and Internet
Explorer 3.x (in most cases) and Internet Explorer 4.x.
Because some JavaScript functions aren't compatible with
Internet Explorer it's always best to test your
JavaScript functions in Both Internet Explorer and
Netscape Navigator before you upload the script to the
Internet. If you forgo this test, some visitors to your
site may not be able to properly view your JavaScripts.
A Bit of History
JavaScript began as LiveScript, an object oriented
programming language created by Netscape and Sun. The
programmers who created JavaScript (nee LiveScript)
wanted to create a language that would create simple
scripts and embed them directly into HTML. Embedding the
scripts into HTML would allow events and effects to
happen on a Web page without invoking a helper program
or plug-in.
Because LiveScript was
created at the same time Sun was developing the language
that eventually became Java, the red-hot,
platform-neutral programming language, there are some
internal similarities between the two languages.
Although it was released before Java, LiveScript was
renamed JavaScript to capitalize on Java's
name-recognition.

|