JavaScript Tutorials is one of the best Quick reference to the JavaScript. In this JavaScript reference you will find most of the things about java script. JavaScript tutorial is classified into sections with examples. This tutorial is mainly for the beginners but experienced programmer can also learn many things from this JavaScript tutorial series. This JavaScript Tutorial will teach you the fundamentals of JavaScript programming, including the use of the core JavaScript objects and the syntax of the language like statements, conditionals, loops, functions, etc. You will also learn how to immediately put JavaScript to validate forms, calculate values, work with image rollovers and create other user interface. JavaScript is widely used scripting language for mainly validating the user input on the client side (browser). It is also used with the DHTML for creating interactive user interface design.
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:
First Java Script <script language="JavaScript"> function sayhello(){ alert("Welcome to JavaScript World!"); }
Click the following link to run your first java script example
Run JavaScript First Program
Writing Simple Java Script Program In this article you learn the basics of JavaScript and create your first JavaScript program. Creating your first JavaScript Program In the last lesson you learned how to create simple java script program. To run the program open the html file in any browser and click on the "Run Java Script First Program". The will display the message box. Here is the screen shot of the browser.
Test JavaScript program from here. Here is the code of JavaScript program:
First Java Script <script language="JavaScript">
function sayhello(){ alert("Welcome to JavaScript World!"); }
Click the following link to run your first java script example
Run JavaScript First Program
Following is the JavaScript program that will show the message: <script language="JavaScript"> function sayhello(){ alert("Welcome to JavaScript World!"); } The alert() function of the java script displays message.
JavaScript Statements In this article you learn the basics of JavaScript and create your first JavaScript program. JavaScript Statement The JavaScript language supported Two type Condition. 1.if statement 2.Function if Statement The if statement is used to make decisions in JavaScript. Boolean operators are also used in along with the if statement. The if statement is the most used features of JavaScript. It is basically the same in JavaScript as it is in other programming languages. Example <SCRIPT language="JavaScript">
document.write("
Statement!") } //--> my program successfully completed Function The function keyword identifies as a function. The parameters in the parenthesis ( ) provide a means of passing values to the function. There can be as many parameters separated by commas as you need. This is perfectly ok to have a function with no parameters. These parameters are variables which are used by the JavaScript statements inside the curly braces { }. The variable keyword is not needed to declare the parameters in a function as variables because they are automatically declared and initialized when the function is called. The function can return a value by using the return keyword. Example <script languane="JavaScript"> function prod(a,b) { var x=a*b return x; } var mul=prod(2,5); document.write("multipication:"+mul); Conditional JavaScript if-else Statement The JavaScript Conditional Statement used to different actions and used to based on different conditions. you want to execute some code if a condition is true and another code the condition is not true, use the if....else statement. Example script type="text/javascript"> var a = new Date() var time = a.getHours() if (time < 20)
{ document.write("Good morning!") } else { document.write("Good day!") }