The combination of HTML and Cascading Stylesheets provides with unprecedented control over the look and feel of the web pages;however by themselves they are static and unmoving.Scripting languages allows to bring interactivity and motion to HTML and CSS.

Scripting languages make the prospect of programming a little less frightening.Scripts are not compiled and must be run with an intepreter that is built into the browser.Programs are run through a seperate piece of software called a Compiler,that converts the program into a standalone application.

Javascript Statement Comments Data Expressions
Variables Functions Flow control Objects Array Others

Introduction to JavaScript

Let's start JavaScript with an example

<body>
<script language="JavaScript">
document.write("Welcome to scripting");
</script>
</body>

The Script tag says that every thing with in these container tags should be treated as a script to be executed.The Scripting language is specified by the language attribute,Here it is set to JavaScript.

The following are the different syntaxes elements that make up a JavaScript programme are:

Javascript Statement Comments Data Expressions
Variables Functions Flow control Objects Array Others

Statements/blocks

A line of JavaScript code is Statement.By placing curly brackets({and}) around a group of JavaScript statements,create a Block.

Comments

Two types of comments in JavaScripts are Single-line and Multiline comments.Single-line comments are great for short descriptions;Multiline comments are best for describing whole concepts or introducing functions

Data

The basic data types are numbers,strings and booleans.The number type can hold both integer and floating-point numbers.The string type can hold group of characters.The boolean type can hold either TRUE or FALSE.

Expressions

The basic type of expressions in JavaScript are Numerical and Logical.A numerical expressions is much like any algebraic expression.A Logical expression must evaluate true or false.

Variables

Holding data over a period of time is accomplished with Variables.

Functions

A function enables to seperate the parts of the program into sections ,making it clearer and less prone to error.Functions are also used to contain and execute a series of statements that are frequently used throughout the script.

Javascript Statement Comments Data Expressions
Variables Functions Flow control Objects Array Others

Flow control

Flow control enables program to choose different paths and loops based on changing conditions.

Objects

Objects enables to encapsulate variables and functions as properties and methods of the objects.

Arrays

Array is used to place a large amount of similar data in a convenient holder.The number of elements to hold in an array head can be specified of time and then can be accessed individualy by positions.

Javascript Statement Comments Data Expressions
Variables Functions Flow control Objects Array Others

Other Scripting Languages

The Scripting languages used other than JavaScript are VBScript and PERL.The only drawback is their compatability to the browsers at present.VBScript is supported only by Internet Explorer.But JavaScript is supported by both Internet Explorer and Netscape Navigator.

Top of this page

Home Overview W3C HTML4.0 Introduction Structure Interactivity
Table Forms Appearance CSS Frameset XML Advanced Technique