Credit: Mulchaey et al (ST Sci/UMD/NASA)
Here is a simple JavaScript program that will work:
<HTML>
<SCRIPT>
document.write(' Hello World ');
</SCRIPT>
</HTML>
All that is necessary is to place it in a file, say,
simple.html and include a reference to it from some existing
page, e.g.,
<A HREF="simple.html">JavaScript</A>
and you are all set.
What JavaScript Can Do. JavaScript is a fully general
purpose language that could conceivably handle any type of problem.
However,
- Client-Side JavaScript is restricted so that it cannot
write anything to the server or client (except cookies)
and cannot read anything from the server except images and JavaScript
programs. It can read, write, and modify cookies on the client
machine.
- It is an interpretive language, so it is not suitable for
compute-intensive problems
- Its main realm of knowledge is the web-browser environment:
it has intimate knowledge of the web structure and can
manipulate and control much of its contents.
- Because it is restricted to the client side it is
very fast, easy to program, and very secure
(however, see the
CERT Advisory
which shows that there now exist some serious security issues).
- It is very closely related to "JScript", operates in the same
environment and with similar operations, as "VBScript"
(although the syntax is totally different), and works
very well with both CGI and Java
- However, JavaScript is NOT a simple form of Java and it is most
definitely NOT a simple language.
|
|
 |
|
 |