Friday, February 20, 2009

JavaScript and JScript

JavaScript and JScript are virtually identical interpreted scripting languages from Netscape and Microsoft. Microsoft’s JScript is a clone of the earlier and widely used JavaScript. Both languages are interpreted directly from the source code and permit scripting within an HTML document. The scripts may be executed within the browser or at the server before the document is sent to the browser. The constructs are the same, except the server side has additional functionally.

JavaScript is an object-based scripting language that has its roots in a joint development program between Netscape and Sun, and has become Netscape’s Web scripting language. It is a very simple programming language that allows HTML pages to include functions and scripts that can recognize and respond to user events such as mouse clicks, user input, and page navigation. These script can help implement complex web page behavior with relatively small amount of programming effort.

The JavaScript language resembles Java, but without Java’s static typing and strong type checking. In contrast to Java’s compile-time system of classes built by declarations. JavaScript supports a runtime system based on a small number of data types representing numeric, Boolean, and String values. JavaScript complements Java by exposing useful properties or Java Applets to script developers. JavaScript statements can get and set exposed properties to query the state or alter the performance of an applet or plug-in.

Comparison of JavaScript and Java applets
Java Script
  • Interpreted (not compiled) by client
  • Object-based, Code uses built-in extensible objects, but no classes or inheritance
  • Code integrated with and embedded in HTML
  • Variable data types not declared (loose typing)
  • Dynamic binding, Object references checked at runtime
  • Cannot automatically write to hard disk
Java (applets)
  • Complied on server before execution on client
  • Object-oriented. Applets consist of object classes with inheritance
  • Applets distinct from HTML (accessed from HTML pages)
  • Variable data types must be declared (strong typing)
  • Static binding. Object references must exist at compile-time
  • Cannot automatically write to hard disk

0 comments:

Post a Comment

 
Template by Administrator Frelia | Anak SD | Blogger