A brief introduction to JavaScript

Recommend this page to Google

JavaScript was created in 1995 with the purpose of making Netscape Navigator more accessible to its newly added support for Java applets.

JavaScript is a lightweight, interpreted programming language with object-oriented capabilities. The general-purpose core of the language has been embedded in all the popular web browsers. The client-side version of JavaScript allows executable content to be included in web pages, which means that a web page does not need to be static HTML, but can include code that can interact with the user, browser and dynamically create and change HTML content

Visually, JavaScript syntax resembles C, C++ and Java, with similar programming constructs such as if statements, while loops and the && operator. The visual syntax similarity however ends with that. JavaScript is an untyped language, which means that variables do not need a type specified.

Many people un-familiar with JavaScript think that it is a simplified version of Java, other then the syntactical resemblance and fact that both JavaScript and Java can execute code in a web browser the two languages are completely un related. JavaScript is touted as a scripting language rather then a programming language, meaning that JavaScript and scripting languages are simpler. But beneath the appearance of simplicity, JavaScript is a full-featured programming language.

So what can JavaScript do?

-Document appearance
Using the write() method you can write arbitrary HTML into a document as it is being parsed by the browser. You can generate documents entirely form scratch. Properties of the Document object allow you to specify colors, text, hypertext links within it. What this amounts to the ability to generate dynamic and conditional HTML content.

-Browser control
Multiple _JavaScript objects allow control over the behavior of the browser. The Window object supports methods to pop-up dialog to display and gather information to the user. This object also defines a method to create, open and close completely new browser windows with specified size and user controls. You can control which pages are displayed in browser using the location object as well navigate though the history object simulating the browsers "Back" and "Forward" buttons.

-HTML form interaction
An important aspect of client-side _JavaScript is the ability to interact with HTML forms. This capability is provided by the form object and the form element object such as buttons, checkboxes, radio, text etc. Another common use for JavaScript is the validation of form data before a form is submitted as well as error checking of users data to prevent round trips to the server.

-User interaction
JavaScript has the ability to define and handler events. When a user clicks or moves the mouse JavaScript code can be executed such as swapping images.

So what can't JavaScript do?

JavaScript does not have any graphics capabilities except for dynamically generating HTML (images, tables, forms, etc) for display in the browser You can not access the file system to read and write. This would be a major security problem. JavaScript does not support networking

Summary
The JavaScript of today is an object-based scripting programming language based on the concept of prototypes. It is most commonly used in websites, but is also used to enable scripting access to objects embedded in other applications. JavaScript is a full-featured, robust language that can be as simple or as complicated as you make it
About The Author: Brock Coffee is IT professional with 10 years experience He is founder http://www.liquidmediastudios.com. LiquidMediastudios sells ready-made website design templates created to use as a basis for fast and high-quality website development. Professional flash and web design templates.

Your rating: None Average: 3 (1 vote)
Keywords: