Topics: HTML, JavaScript, Document Object Model Pages: 15 (3003 words) Published: May 20, 2013
What is JavaScript?
JavaScript is a scripting language, that is, lightweight, dynamic, loosely typed, prototype-based  programming language which is used in many different environments. * A lightweight programming language that is interpreted by the browser engine when the web page is loaded.

* Dynamic programming languages execute at runtime; they are not compiled. Because of this, JavaScript is sometimes considered a scripting language as opposed to a true programming language (obviously a misconception). When you have JavaScript within an HTML document it will be parsed as the page loads within the browser, hence at "runtime".

* Loosely typed languages do not insist upon any strong typing system. If you’ve programmed in C or Java (not the same as JavaScript) you’ll know that when declaring a variable you have to specify a type such as ‘int’ (integer). JavaScript is different in that you don’t need to specify the type.

* To perform inheritance within JavaScript you have to use something called prototypes. JavaScript does not support classes.

Features of Java Script.

* JavaScript is Browser Side Scripting Language.
* Script that executes on local Browser is called browser side scripting. * Usually Client / web surfer’s PC is called local PC.
* JS Script is embedded in the HTML page,
* When user requests particular page containing script, script executes in local browser.

* JavaScript is designed to add interactivity to HTML pages. Adding JavaScript to your HTML code allows you to change completely the document appearance, from changing text, to changing colors, or changing the options available in a drop-down list, or switching one image with another when you roll your mouse over it and much more. JavaScript can be used to make HTML pages more dynamic. All plain HTML files are static.

* JavaScript is Lightweight Programming Language.
* JS adds programming facility to HTML page.
* JS provides us programming facilities to certain extends. such as – Loops, Arrays, Decision making etc.

* JavaScript is embedded directly into HTML pages.

* JavaScript is an interpreted language.
One of the main advantages of using JavaScript is that it is an interpreted language in which scripts are directly executed without preliminary compilation. You can't compile Javascript to bytecode and run it anywhere * Java Script is Free to use.

You are not required to purchase a license in order to use JavaScript.

* JavaScript is supported by many popular Web browsers, including all remotely recent versions of Microsoft Internet Explorer and Netscape Navigator, but sometimes you have to turn on the capabilities in your

* Browser Detection
Detecting the browser used by a visitor at your page. Depending on the browser, another page specifically designed for that browser can then be loaded.

* Cookies 
Storing information on the visitor's computer, then retrieving this information automatically next time the user visits your page. This technique is called "cookies".

* Control Browsers 
Opening pages in customized windows, where you specify if the browser's buttons, menu line, status line or whatever should be present.

* Validate Forms 
Validating inputs to fields before submitting a form. An example would be validating the entered email address to see if it has an @ in it, since if not, it's not a valid address.

How does it work?
JavaScript is what is called a Client-side Scripting Language. That means that it is a computer programming language that runs inside an Internet browser.  Inside a normal Web page you place some JavaScript code. When the browser loads the page, the browser has a built-in interpreter (also called JavaScript engine) that reads the JavaScript code it finds in the page and runs it. JavaScript engine is different for each browser, and in fact may be different between versions of the same...
Continue Reading

Please join StudyMode to read the full document

Become a StudyMode Member

Sign Up - It's Free