JavaScript - Then and Now
Some changes you can make to improve your JavaScript are a result of changes in what browsewrs support. Some changes you ought to make are because of changes in what is considered to be the best way to write your script. Some changes may just be a matter of your having learnt better ways to do things.
What we are going to do here is to take a fully functional script that I wrote some years ago and an equivalent script that I wrote recently and analyse the differences between them.
- Falling Snow
The new completely unobtrusive version of this script (you can download the original for comparison).- Accessing The DOM
Since I wrote the first version of the falling snow script in 2004 the standard DOM has been implemented in all browsers and no one uses IE4 or Netscape 4 any more. - Accessing The BOM
Over the years I have seen a variety of solutions to the difference in the way JavaScript can interact with the browser. My current solution is much shorter than the way I used to do it. - Defining Variables And Starting The Script
Best practice on how to define your variables and on where to attach scripts to a web page has changed over the years. - document.write And The DOM
Now that all browsers support the standard Document Object Model there is no need to ever use document.write in your JavaScript. - setTimeout and setInterval
You see poorly coded setTimeout statements in so many scripts that it can take a while to realise that you are not coding your setTimeout the most efficient way and that in many instances a setInterval may be more appropriate.
- Accessing The DOM
We now have Package Deals to create and maintain your website for you.
(includes special prices for community groups and hobby clubs)
Copyright © Felgall Pty Ltd



