| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

JavaScript

Page history last edited by PBworks 17 years, 11 months ago


 

What is Javascript?

 

JavaScript is the name of Netscape Communications Corporation's implementation of ECMAScript, a scripting programming language based on the concept of prototypes. The language is best known for its use in websites, but is also used to enable scripting access to objects embedded in other applications.

 

Javascript is not Java!

 

Despite the name, JavaScript is only distantly related to the Java programming language, the main similarity being their common debt to the C programming language. JavaScript has far more in common with the Self programming language.

 

JavaScript is a prototype-based scripting language with a syntax loosely based on C. Like C, the language has no input or output constructs of its own. Where C relies on standard I/O libraries, a JavaScript engine relies on a host environment into which it is embedded. There are many such host environment applications, of which web technologies are the most well known examples. These are examined first.

 

One major use of web-based JavaScript is to write functions that are embedded in or included from HTML pages and interact with the Document Object Model (DOM) of the page to perform tasks not possible in HTML alone. Some common examples of this usage follow.

 

Debugging

 

JavaScript debugging has some specifics in comparison with stand-alone applications. First of all JavaScript is an interpreted language so errors do not appear until the relevant program block is run. Second, JavaScript programs usually rely on interaction with the loaded page's Document Object Model (DOM) so errors may be caused by wrong DOM usage in a technically correct script.

 

Because JavaScript is interpreted, loosely-typed, and must run at the client-side in varying environments (host applications), implementations and versions the programmer has to take extra care to make sure the code executes as expected in as wide a range of circumstances as possible, and that functionality degrades nicely when it does not.

 

Related languages

 

As mentioned above, there is no real relationship between Java and JavaScript; their similarities are mostly in basic syntax because both are ultimately derived from C. Their semantics are quite different and their object models are unrelated and largely incompatible.

 

Like C and C++, all Java variables and members are statically typed, whereas all JavaScript variables (as well as object properties and array elements) may hold a value of any type.

 

Microsoft's own VBScript, like JavaScript, can be run client-side in web pages. VBScript has syntax derived from Visual Basic and will only run if the web pages are viewed in Internet Explorer.

 

Due to the success of JavaScript, Microsoft developed a compatible language, which it called JScript. JScript was first supported in Internet Explorer version 3.0, released in August, 1996; when web developers talk about the use of JavaScript in the IE browser, they usually actually mean JScript.

 

The need for common specifications for these two languages was the basis of the ECMA 262 standard for ECMAScript.

 

The object model of browser-based JavaScript, the Document Object Model (DOM), is actually not part of the ECMAScript standard. It is defined in a set of separate standards3, developed by the W3C and is applicable to the access and manipulation of HTML and XML documents in many computer languages and platforms.

 

ActionScript, the programming language used in Macromedia Flash, is based on the ECMAScript standard, so it closely resembles JavaScript in syntax.

 

JSON, or JavaScript Object Notation, is a general-purpose data interchange format that is defined as a subset of JavaScript.

Comments (0)

You don't have permission to comment on this page.