Next
Contents 
ABC of JavaScript : An Interactive JavaScript Tutorial
ABC of JavaScript : An Interactive JavaScript Tutorial

ABC of JavaScript : An Interactive 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.

Uses of JavaScript

JavaScript lets you create applications that run over the internet. Using JavaScript, you can create dynamic HTML pages that process user input and maintain persistent data using special objects, files, and relational databases. You can build applications ranging from internal corporate information management and internet publishing to mass-market electronic transactions and commerce - but those are the function of server side javascript. We will not be touching that - we are more intrested in Client Side JavaScript.

If you are still not impressed, JavaScript can be used to create small games. Ah, I see that I have got your attention at last. A bit more about JavaScript before starting on the tutorial.

About JavaScript

JavaScript or JScript(Microsoft version of JavaScript) is a language that can be seen as the next step from HTML. It would seem that HTML is more concerned with the simple display of text and images. That is where JavaScript comes in - it offers more interactivity for the user and above all more choice and understanding of the world wide web.

Before starting, I would like to say that JavaScript is entirely different from Java. JavaScript is made by netscape while the other is made by Sun. The purposes of the two languages has almost nothing in common.

This JavaScript tutorial will assume that you have a general understanding about the internet and web developing. You have to know HTML before studying JavaScript. It is preferable that you know some other languages like C, C++, Perl etc. - but it is not a necessity.

T-Box

Now let me introduce you to a main feature of this tutorial - the "Test Box" AKA "T-Box".

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 the setting.
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).

Next
Contents 

Comments

Sue W at 12 Mar, 2007 12:55
"broswer"
Reply to this.
Binny V A at 13 Mar, 2007 08:29
Fixed now - thanks.
Reply to this.
Bidfreelancers at 10 Jun, 2007 05:20
Cool but need more complex things to learn.
Reply to this.
yogurtt at 06 Aug, 2007 06:12
yes...need to learn more about this...
Reply to this.
Kathleen of Creich at 28 Sep, 2007 04:11
Is this field off. Am disabled and JC courses can't accommodate. Keep getting message that Javascript is not enabled yet Foxfire prefrances
say it is.
Reply to this.
Chat at 17 Feb, 2008 06:45
See browser documentation to see how this can be done.
Reply to this.
Comment


Comment




Comment Formating : HTML tags a, strong, em, b, i, code, pre, p and br allowed. Other tags will be shown as code(< will become &lt;). Urls, Line breaks will be auto-formated.