What is JavaScript? - Definition

In this article you learn the basics of JavaScript and create your first JavaScript program.

What is JavaScript? - Definition

     

In this article you learn the basics of JavaScript and create your first JavaScript program.

What is JavaScript?
JavaScript is scripting language used for client side scripting. JavaScript developed by Netscape in 1995 as a method for validating forms and providing interactive content to web site. Microsoft and Netscape introduced JavaScript support in their browsers.

Benefits of JavaScript
Following are the benefits of JavaScript.

  • associative arrays
  • loosely typed variables
  • regular expressions
  • objects and classes
  • highly evolved date, math, and string libraries
  • W3C DOM support in the JavaScript

Disadvantages of JavaScript

  • Developer depends on the browser support for the JavaScript
  • There is no way to hide the JavaScript code in case of commercial application

Creating your first JavaScript Program

In the first lesson we will create very simple JavaScript program and run in the Internet Explorer. This example simply displays "Welcome to JavaScript World!" message in the browser.

Test JavaScript program from here.

Here is the code of JavaScript program:

<html>
<head>
<title>First Java Script</title>
<script language="JavaScript">
function sayhello(){
alert("Welcome to JavaScript World!");
}
</script>

</head>
<body>

<p><b>Click the following link to run your first java script example</b></p>
<p><a href="javascript:sayhello()">Run JavaScript First Program</a></p>

</body>