Introduction to JavaScript

JavaScript is a programming language designed for use in a web browser.It is lightweight and most commonly used as a part of web pages.It is an interpreted programming language with object-oriented capabilities.JavaScript can be placed in the <body> and the <head> sections of an HTML page.JavaScript code must be inserted between <script> and </script> tags in HTML.

A Simple JavaScript Code

<script>
$(document).ready(function(){
alert(‘hello world’);
});
</script>click here for demo

How to Run JavaScript?

javascript1_1



The browser is responsible for running JavaScript code because JavaScript cannot run on its own. The user requests javascript from an HTML page, the script is sent to the browser and it is up to the browser to execute it. All modern web browser supports JavaScript. So, you do not have to worry whether your site visitor uses Google Chrome, Internet Explorer, Firefox or any other browser. And also JavaScript runs on any operating system including Linux,
Windows or Mac. Thus, JavaScript overcomes the main disadvantages of VBScript which is limited to just IE and Windows.

Advantages of Javascript

  • Javascript is executed on the client side
  • Javascript is a relatively easy language
  • All modern web browsers support JavaScript.
  • Javascript is relatively fast to the end user
  • Extended functionality to web pages
  • Less server interaction

Disadvantages of Javascript

  • Security Issues
  • Javascript rendering varies



  • Javascript is relatively fast to the end user
  • Client-side JavaScript does not allow the reading or writing of files.
  • JavaScript cannot be used for networking applications

Tools You Need

You need a text editor like notepad or notepad++ to write your code and a browser to display the web pages you develop. You can use any web browser including Google Chrome, Internet Explorer, Firefox etc. And text editors like notepad, notepad++,netbeans, Komodo Edit, Webuilder etc.




Summary

  • JavaScript can be run on any operating systems and almost all web browsers.
  • JavaScript is a client side scripting language

3 thoughts on “Introduction to JavaScript

  1. Prince

    Hi Pritty,
    I want to know which is best editor for javascript programming which provides Auto-completion,highlighting error’s in script like eclipse does for Java.

    Reply
    1. Pritty

      netbeans version 7.3 above

      Apart from all the above it supports JS based mobile app using cordova framework, JS editing for code embedded in PHP, JQuery support, code analysis and much more

      Reply

Leave a Reply to Prince Cancel reply

Your email address will not be published. Required fields are marked *