This is an outdated page. Please go to Advanced JavaScript Tutorial at http://www.openjs.com/ for the latest version.

Advanced JavaScript Tutorial
Next
Contents

Advanced JavaScript Tutorial

JavaScript is Netscape's cross-platform, object-based scripting language for client and server applications. It has dominated the world of internet scripting languages for a long time now.

JavaScript or JScript is a language that can be seen as the next step from HTML. HTML is concerned with the simple display and presentation of text and images. JavaScript offers more interactivity for the user and above all more choice and understanding of the world wide web.

The Advanced JavaScript Tutorial assumes you know the basics of JavaScript language - if you don't already know it, I would suggest to take the time to learn it now. I have written a Basic JavaScript Tutorial - and I would recommend it if you are a beginner to this language. Even if you know JavaScript, I would recommend that you take the last three chapters of the Basic JavaScript Tutorial. Feel free to jump around the basic tutorial if you already know javascript.

If you still think that you don't need the basic tutorial, let me introduce you to a unique feature of this tutorial - The T-Box or the Test box. The readers of Basic tutorial have already met this feature.

This is a T-Box. You can type javascript commands into it and it will execute them. With this you can immediately test your knowledge after you learn about a feature of javascript. A problem with the T-Box is that it would not show an error if you mistyped some thing in it and press 'Run' - try it. Type this in the box and hit run.
aler("This is wrong")
Nothing is shown(by default). This is because there was an error('alert' is spelled 'aler') and your browser suppressed the error message. You should turn on the error notification of your browser if you wish see the errors you have made - trust me, they will be many. Just do the following for your browser

Microsoft Internet Explorer
Choose Tools -> Internet Options, and select the 'Advanced' tab. Make sure that the 'Display a notification about every script error' is ticked. Click 'OK' to save settings.
Mozilla
Select the 'Tools -> Web Development -> JavaScript Console' or type 'javascript:' in the address bar. This will open a window that will show a list of all javascript errors. The last error in the list is the most recent one - the one you made.
Other Browsers
See browser documentation to see how this can be done.

If done correctly, the above example(aler("This is wrong")) will show an error 'Object expected'(IE) or 'aler is not defined'(Mozilla).


  Contents Next