WPDFD Issue #73 - April 01, 2004

JavaScript rollovers are unnecessarily complicated requiring a set of normal and 'over' images to be preloaded into the browser before they work correctly. The code then swaps one image for another based upon an 'onmouseover' event. What I'm going to describe here is an alternative method of achieving the same effect that has several advantages. It uses less code, loads more efficiently and makes it simple to have multiple button states.

After covering the basics of text formatting last month, this month we move on to layouts. Up until recently, most Web page layouts were achieved using tables. Tables are fairly easy to understand from a conceptual point of view and most WYSIWYG editors make them easy to configure – adding and deleting rows and columns, merging cells together etc. The trouble is that tables were never intended to be used for layout, no more so than Microsoft Excel can be a DTP program.

Most Web designers have used JavaScript. Whether it is just to make a button rollover or 'sniff' a browser version, they will have either used a pre-programmed script generated by their WYSIWYG editor's 'actions' or copied and pasted it from another script. Lots of people use JavaScript like this without really understanding it - and it's not all that difficult. The trouble is that you don't learn anything from using a program's 'action' menu, you need to sit down and take it from the beginning with a good book.

Beginning PHP 4

After JavaScript, PHP is probably the next best step towards making your Web pages more dynamic and interactive. Unlike JavaScript which runs on the reader's machine (client side) and is very limited in what it can do, PHP is run on the server, is much more powerful and not all that more difficult to come to terms with. The book explains how to set up PHP 4 to run on your own machine, well, it does for Windows and Linux.

Learning Perl

With its roots in UNIX, Perl is a bit more difficult than JavaScript or PHP but it is the standard for CGI scripting on the Web. There are loads of free Perls scripts available to download and they are relatively easy to install and get running. With a little more effort, you can learn to 'hack' them to modify their operation for your own needs. Learning Perl is a bestseller, and rightly so. It takes a fairly difficult subject and makes it approachable with a light-handed style of writing but it needs to be taken one step at a time.