HTML and CSS Reference
In-Depth Information
Figure 10-6
combining client-side and server-side programming
4) a server-side program processes
the data from the client-side program
1) user retrieves
Web page
3) information is sent from
the program to the server
2) user runs a program locally
In this tutorial you'll work only with client-side programming. However, it's important
to be aware that in many cases, a complete Web programming environment includes
both client-side and server-side elements.
The Development of JavaScript
Several programming languages can be run on the client side. One popular client-side
programming language is Java in which code is stored within stand-alone programs
known as java applets . However, creating a Java applet required access to the Java
Development Kit (JDK), so nonprogrammers found it difficult to write their own applets.
Another client-side programming language is javascript , which despite in similarity in
name, differs markedly from Java in several important ways. Java is a compiled language ,
meaning that the program code must be submitted to a compiler that manipulates it,
translating the code into a more basic language that machines can understand. For Java,
this compiled code is the Java applet. Therefore, to write and run a program written in a
compiled language, you need both the compiler and an application or operating system
that can run the compiled code.
JavaScript, on the other hand, is an interpreted language , meaning that the program code
is executed directly without compiling. You need only two things to use JavaScript: 1) a text
editor to write the JavaScript commands, and 2) a Web browser to run the commands and
display the results. This means that JavaScript code can be inserted directly into an HTML
file, or placed in a separate text file that is linked to a Web page. Figure 10-7 summarizes
some of the key differences between Java and JavaScript.
 
Search WWH ::




Custom Search