WDN Logo

home-icon Home / JavaScript / JavaScript Tutorial

JavaScript Tutorial

JavaScript Tutorial

Online JavaScript Tutorial

This online Javascript tutorial been very well received judging by the number of emails I get. JavaScript is a vast language and it is not possible to teach everything in these 35 tutorial sessions. However, we will cover most of the basics – statements commands and functions.

By the way, this tutorial was written for someone who has no programming experience. And I assure you that as long as you have access to a computer (and a bit of dedication), you would be able to start programming in JavaScript.

Sponsored Links

I had put the tutorial offline for a while to correct errors. These have now been removed. However, if you find some, please do let me know. Enjoy!

JavaScript History

Web pages made using only HTML are somewhat static with no interactivity and negligible user involvement. Interactive pages can be described as those that understand and process user behaviour (actions) like mouse movements, mouse button clicks, HTML button clicks etc.

HTML tags are just instructions on document layout and structure; the display of the document in the window is dependent on the browser. Interactive pages cannot be built with only HTML, we need a programming language. Further, since the response time to user actions should be quick, the programming language has to be embedded in the browser itself. (Programs residing on servers can not bring about interactivity due to the time taken for sending the user input and receiving the response.)

Keeping these things in mind, the people at Netscape came out with a client-side (read browser) language that was integrated with version 2 of Netscape Navigator. They called this language JavaScript. (Actually, JavaScript was initially christened LiveScript. Seeing the popularity gained by Sun Systems’ Java, the bigwigs at Netscape changed its name… a clever marketing ploy. Eh?)

Microsoft’s implementation of JavaScript is called JScript and was first introduced with version 3 of Internet Explorer.

JavaScript is thus, a client-side scripting language. There is also a server-side version that is used in Active Server Pages, a technology promoted by Microsoft. This tutorial describes only client-side JavaScript.

JavaScript enables browsers to take decisions and process information. This is the key to interactivity.

JavaScript now

At the time of writing, JavaScript is in version 1.2 and is soon to be standardized by the International Standards Organization.

Why do you need JavaScript?

Here are a few things you can do with JavaScript:

  • Validate forms at the client-side saving both the precious server resources and time.
  • Create mouseover effects, change background color of a document with a click of a button… interactivity!
  • Randomly display content without the involvement of server programs.
  • Move HTML elements around pages.
  • Change page contents dynamically.
  • Load content in new browser windows and frames.
  • Make online games.

Nature of JavaScript

JavaScript is based on Object Oriented Programming concept. Its syntax is quite similar to C, C++ and Java. However, it is much easier to learn and implement.

Other Client-side languages like Javascript

VBScript: Implemented only under Internet Explorer, this client-side language is similar to BASIC. It is commonly used in ASP technology.
PerlScript: Similar to the Perl Language. Not very well supported by browsers.

What is covered in this Javascript tutorial?

Since this Javascript tutorial was written keeping in mind a novice, we start with the very basics, gently touching JavaScript methods and event handlers and then moving on to variables, loops, functions etc. In the following sessions on this tutorial, you will learn how to detect browsers, print current date and time on a web page, change images on mouse-over, display statements in the browser Status Bar and several other nifty things. Once you get a grasp of these sessions, you can build over what you have learnt through practice and consulting a JavaScript reference.

Sponsored Links

Search

Your comments
Star icon IMPORTANT Have a question / problem? Click here to ask an expert.

Caps Lock jokes and funny images

Sponsored Links

Tips

How do I view a deleted web page?
Is there a way to view a deleted web page - one that is no longer available? Yes there is and the solution is quite simple. [more...]

Fact

The computer's "Copy-n-paste" feature was first implemented in the Gypsy word processor developed at Xerox Palo Alto Research Center in 1970s. [more...]

Share on Whats app Share on Facebook Share on Twitter Share on Google plus