Tutorials
JavaScriptIn this JavaScript tutorial, you will learn about introduction to JavaScript, why JavaScript, differences between Java and JavaScript and advantages of JavaScript.
JavaScript was first developed by Netscape as an open scripting language to create interactive web pages. Script is nothing but a small program which is generally very easy to learn and use. JavaScript as an open language implies that it can be used by anyone; no license is required to use JavaScript. Microsoft created Jscript for its Internet Explorer similar to Netscape JavaScript. JavaScript has the ability to function both as an object oriented language as well as procedural language. Using JavaScript you can create objects, attach methods and properties. Though JavaScript can run on both client-side and server-side, it is very popular among client-side scripting languages. Client side means the script runs on client browser. JavaScript are generally embedded in the header of web pages.
JavaScript plays a vital role for adding interactive feature to HTML web pages. JavaScript can respond to several events that occur on web-pages and thereby help in designing dynamic and interactive web-sites. Moreover JavaScript makes it very easier to validate a form, check if any fields are empty and verify correctness of data. JavaScript does all these at client side even before actually sending the data to server, thereby reducing considerable load on server and thus makes form processing easier and quicker. Millions of web-pages and server applications make use of JavaScript all over the world, there is no doubt that almost all major web-browsers support JavaScript.
JavaScript Example
<HTML>
<HEAD>
<TITLE>My First JavaScript</TITLE>
</HEAD>
<BODY>
<H1 ALIGN=CENTER>
<BR /><BR /><BR />
<SCRIPT LANGUAGE="JavaScript">
document.write("My First JavaScript")
</SCRIPT>
</H1>
</BODY>
</HTML>
Output

JavaScript can be used in different ways within an HTML file.
1. header scripts
In this type, JavaScript is embedded between <SCRIPT> tags within the <HEAD> tag and is used for initializing variables and or create functions that can be called from anywhere of the entire script. JavaScript in header is executed once when the page is loaded.
2. body scripts
In this type, JavaScript is embedded between <SCRIPT> tags within the <BODY> tag. JavaScript within Body Tags are used for handling various events.
3. called directly when certain events occur
In this type, JavaScript are called when certain events occur. Example of events include onLoad, onClick, onError, onSelect, onSubmit, onChange etc.,
JavaScript is different from Java programming language, Unlike Java, which needs compilation; JavaScript is dynamic and is interpreted in run-time. Though there are some similarities like both Java and JavaScript are client-side programming language, both descend from C++ yet both Java and JavaScript differ in many ways.
JavaScript was mainly developed for web pages or web sites to add interactive facility or feature and there by making programming effort easier, enable users to interact with web sites and there by making it user-friendly. In addition to interactive facility JavaScript also helps in giving a dynamic functionality for a webpage which helps JavaScript to handle large volume of data during online processing.
JavaScript offers numerous features which makes it popular. Few among them are listed below:

| I just want to say thanks for providing all great tutorial to help everyone at web world. |
|
Hi Guys, Just want to share a link which can really help on any of the queries related to Javascript and DHTML. Refer to the MSDN link: http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/dhtml_reference_entry.asp?frame=true For any element of HTML you can see what all things can be supported, including events. This can be called as a Bible for people who want to refer. Cheers, Sharath |
| its good tutorial to provide us a great information about different languages |
|
Its a great thing to make peaple study online and get a good knowledge for there future betterment. Excellent!! Thanks n regards |
|
Hello this is Irshad from Hyderabad.. i was searching for all these notes at the net and i was struggling alot to download all the notes at my disk..! but now i felt all that i need is at my disk...! i really thankfull to www.exforsys.com to providing all these notes to me...! |
|
Hiiiiiii, This site is very nice. It has a abundunt source of knowledge and information. Its really awersome.. Many people will get answers of all their queries at only one place and that is WWW.EXFORSYS.COM |
|
Hello This is very good for online learing.You r doin a great job.Excellent Keep it up... Thanks... |
| Your r doing an excellent job for online learning.thanks.keep it up.......... |
| This tutorial is very good....... |
|
www.exforsys.com is a woderful for all the beginers who want to learn more about programming u get lots of information through this site.thank you exforsys. |
|
This tutorial is veryyyy good |
|
Hi, This site is very very important for knowledge seeker,I really appreciate & thanks those people who first made plan to lounch such types of nice web site. I hope they will keep on in future & will provide latest technologies skills to us. With Regards Komal |