A JavaScript page, however, can validate the data entered before it is sent to server


A JavaScript page, however, can validate the data entered before it is sent to the server. If the data is invalid, JavaScript can block transmission to the server.
Because all of this work is performed on the client side, JavaScript does not waste bandwidth transmitting bad data and then receiving an error page from the server.

JavaScript can also replace some of the animation and page-reloading


JavaScript can also replace some of the animation and page-reloading functionality of CGI. To perform animation and page-reloading, CGI provides mechanisms called “server push” and “client pull.”
With server push, the Web page server maintains a connection between the client and server. Server push restricts the number of simultaneous connections the Web page server can maintain-a popular page using server push will frequently reward potential visits with a “sorry, not now, try later” message. Client pull, on the other hand, involves the client frequently re-establishing its connection to the server, artificially adding to the traffic at the server.

You can use JavaScript to create dynamic documents


You can use JavaScript to create dynamic documents that would have required either server push or client pull in CGI.
You are absolutely correct but that would involve no additional traffic or long drawn-out connections between the client and the server.

Some web space providers only allow the use of a limited set of applications


Some web space providers only allow the use of a limited set of applications. Many providers do not support server push CGI.
JavaScript running on the client browser is perfectly safe to the server, and affords you, the creator of the JavaScript document, much greater flexibility in how your document interacts with the reader.

Java is a programming language and JavaScript is a scripting language


Java is a programming language and JavaScript is a scripting language. Java programs are compiled on the server.Java programs are compiled on the server.
You can write stand-alone programs in Java. Scripts written in JavaScript are interpreted by the browser. You cannot write stand-alone programs in JavaScript-you need a browser to interpret JavaScript.

Java script is object based while the java is object orientedJava is object-oriented.


Java is object-oriented. It employs classes and inheritance. It provides encapsulation of data.
But the JavaScript is object-based. There are no classes. There is no inheritance. Data within objects is readily accessible.

java script is loosely typed,while the java required the data types be strongly typed


Java requires that data types be strongly typed.If a function expects one of its arguments to be a number, the function will not accept a character string.
JavaScript is loosely typed. JavaScript has numbers, character strings, and Booleans and freely interchanges them.

Java can be used to create very powerful applications


Java can be used to create very powerful applications. JavaScript scripts cannot really do all the neat things that Java applets can.
On the other hand, it is much more difficult to write programs in Java than it is to write scripts in JavaScript.

You can create documents that split the browser window


You can create documents that split the browser window into pieces-you have probably seen such documents while surfing the Web.
The pieces are called frames, and much of JavaScript’s power derives from what it can do with frames.

Frames give you more control over the layout of your document than conventional HTML


Frames give you more control over the layout of your document than conventional HTML allows, and frames let you keep parts of your documents on the screen while other parts change. For example, in one frame you can place a corporate logo, copyright information, and so forth; in another frame, you can place a document describing some particularly interesting information about your company.
As the user pages through your Web site, the frame that holds your logo and copyright can remain visible while the information in the other frame changes.