What Is My I.P Address?  
  Home |  Help |  About Us |  Contact Us |  Donate  

What Is JavaScript?

First let's define what a Script is before we learn about JavaScript. A Script is a set of instructions given either to your browser, or a web server, that is essentially an "Active" command, in other words, it does things rather than a static HTML page. Let's go through a few examples:

  • lets say you want to contact a website to ask a question, most of the time you will be presented with a form. When you have finished filling out the form, there will be a button that says "Submit" or "Send" (see figure 1.a below), when you click this button all the information in the form will be sent to a Script that lives on the web server. This Script will (among other things) make a record of your details in a database, format the data into an email and send it to the website owner. This type of Script is called a Form Processor and is also an example of a Server Side Script because all the activity takes place on the web server.
Example of an HTML form
  • Now lets take the same situation except this time you forget to choose your country and it is left on "Please Select". You click the Submit button, but instantly there is a little alert box advising you of your mistake (see figure 1.b below). This is JavaScript and is an example of Client Side Scripting because all the activity takes place inside your browser.
Example of a JavaScript alert box


As you have probably guessed, JavaScript is a Client Side scripting language processed by your browser. Most browsers have a built in JavaScript "Engine" or interpreter that reads the instructions and acts upon them. The Script in the last example basically said "If the user forgets to enter their country, make an alert box and advise them of their mistake". JavaScript can do a whole lot more too, for instance: validate forms, effects like fade and blind, rollover menus and now with Ajax the sky is the limit. JavaScript is also quite easy to program, has been around since the mid 90's and is widely used, so that's why you have probably heard about it. You have the option to turn JavaScript on or off in your browser and by default most browsers have it enabled, however it is recommended that you leave it enabled so you can enjoy all the web has to offer. If you need help checking your browsers JavaScript status, visit our guide on how to enable or disable JavaScript. This guide is intended to give a conceptual overview of JavaScript, if you are interested in studying it just visit W3Schools for complete tutorials and reference.

Further Reading