AlfieWebDevTips Homefor new and experienced developers
[Home Home] [Web Development Web Development ] [Code Generators Code Generators ] [Resources Resources ] [Forums Forum ] [Contact Us Contact ] |WebDevTips Privacy Privacy |

WebDevTips Pick Of The Day : ".$todaytip[$today]." |

"; ?>
Print This Page



 


You are here : Home - Web Development - Javascript - Getting Started

Getting started with JavaScript



This guide will help get you started on writing your own scripts with simple examples and explanations.

What is JavaScript?

JavaScript is a scripting language which allows you add interactive content to your webpages. You can use your favorite text editor to write javascript as it's written in plain text. No special software required.

I would advise against using a WYSIWYG (What You See Is What You Get) editor while learning javascript as each WYSIWYG editor has their own way of implementing javascript which could hinder rather than help at this stage.

Javascript is also known as client side scripting. All this means is that the code is run from your browser. There are slight variations on how each browser interprets the code, which can produce undesired results. I would recommend that you test your scripts for errors in different browsers.

Before we start

Javascript has many uses on the web but before we start there are some things you should be aware of.

Be aware that javascript can be disabled by the user and you should always make sure that your page works with javascript disabled. With javascript less is more. Do not annoy your visitor with usless javascript alerts and prompts for their name etc. Alerts when used in the correct place can be useful but when used just because you know how to make them can really annoy.

Javascript should be used to enhance your webpages, your webpages should not be dependant on javascript and your navigation should work without javascript.

What's the point?

At this point you might be wondering if there is any point in learning javascript. Well the answer is yes. Javascript, as mentioned before, can enhance you webpages.

Example :
Say you have a form on your site which, when submitted adds the information to a database. The script on the server makes sure that the information entered into the form is in the correct format. If there is something wrong with the information then you are returned to the page to correct the incorrect items.

Doing all this checking on the server is neccessary but we can reduce the amount of work the server has to do by using javascript to check the form entries before it gets sent to the server.

The script that processes the form on the server should always check the data entered but by using javascript we can tell the visitor as soon as he hits submit that something is wrong without making any demands on the server.

Take your time and work through the pages in order, making sure you understand each section before moving to the next. Most of the examples are fairly straight forward and it's recommended that play about with them and make changes to help understand them better.

First we'll take a look at the script tag

Don't forget our forum where you can ask for help if there's anything you don't understand.




16 Nov 2003




Google
 

[back to top of page]   

[labelled with icra -  - this link will open in a new window] [RSS Content]

[Copyright © WebDevTips]