Monday 1 July 2013

Javascript Overview

 What is JavaScript ?

JavaScript is a scripting language. JavaScript made its first appearance in Netscape 2.0 in 1995 with a name LiveScript  but Netscape changed the name, possibly because of the excitement being generated by Java.to JavaScript.

And Latest JavaScript version is 1.8

1. JavaScript is a lightweight, interpreted programming language with object-oriented  
    capabilities that allows you to build interactivity into otherwise static HTML pages.
2. Complementary to and integrated with Java.
3. Complementary to and integrated with HTML.
4. Open and cross-platform.

5. All Browsers (IE,Mozila,Chrome,Safari) supports JavaScript language.

Javascript has 2 type of script:

1. Client-side JavaScript
2. Server-side Javascript

 Client-side JavaScript:


  • Actually JavaScript is purely client side JavaScript language which is executed on any Browser without reloading page. Before redirecting it verifies all JavaScript code then it will redirect to url.
  •  The JavaScript client-side mechanism features many advantages over traditional CGI server-side scripts. For example, you might use JavaScript to check if the user has entered a valid e-mail address in a form field.
  • The JavaScript code is executed when the user submits the form, and only if all the entries are valid they would be submitted to the Web Server.

  • JavaScript can be used to trap user-initiated events such as button clicks, link navigation, and other actions that the user explicitly or implicitly initiates.
 Limitations
  • Client-side JavaScript does not allow the reading or writing of files. This is keep for security reason.
  • JavaScript can not be used for Networking applications because it will not support available.
  • JavaScript doesn't have any multi-threading or multiprocess.
 If you are using JavaScript on HTML page then you have write like this so  browser will understand,
The <script> tag alert the browser program to begin interpreting all the text between these tags as a script.


 






 Server-side JavaScript: 

In many language like as PHP, Python, ASP, Perl,etc... you can see if user submit any form after filling then this server side script will check all data which is filled by user and validate, if user information is not correct then it will throw serverside javascript validation after reloading the page.

 

No comments: