An Introduction to Javascript

JavaScript (JS) is primarily targeted at relieving the “boredom” caused by static HTML pages. JS is a dynamic language which can respond to user actions. Therefore clicking actions and placing the mouse on top of an object can be made to cause reactions.

A “behavior” is the title given to how an object will react. Behaviors can be triggered by “events”, such as double clicking or clicking an object. The rollover effects, drop down menus etc are all results of behaviors as a result of an event taking place. These effects serve to make your webpage look dynamic and less boring.

You should keep in mind that JS is a Client Side programming language. This essentially means that the code is sent to the user’s machine to be compiled and executed. This execution is done by the browser and sometimes the JavaScript function is turned off by the user or by default. This presents developers with a few problems. All the hard work you put into the JS code is non-existent if the browser does not execute the code. There is also the problem that any validation code you use will also be of no use. However, the latter can be countered by having a server side programming language double checking whatever input your page receives, but this does mean more work for the programmer.

JS did have a bad reputation at one point where it was used by malicious sources to cause havoc on users’ computers. This is the reason why many users kept JS switched off on their browsers. However with newer browsers like Google Chrome and Apple Safari handling JS faster and better, users are now placing more confidence in pages which use JavaScript.

No Comments Yet

Leave a Reply

Your email address will not be published. Required fields are marked *

Archives