Javascript and CSS file timestamps with PHP

Many websites I have worked on have frequently modified CSS style sheets and Javascript library files. In order to prevent Javascript errors or layout and style issues caused by web browsers caching these files, I used to rename the file for each revision, and then modify the name of the CSS or JS file in my PHP header include files. This article looks out how I now do this using the modified timestamp of the file.

Assigning values to associative arrays in Javascript

Javascript has zero indexed integer arrays and also associative arrays. They work in a similar manner but there is a useful way to be able to initialise an associative array with both keys and values in one call. This post will look at the way a zero based integer based array can be initialised and then the ways it can be done with associative arrays in Javascript.

Using Javascript to focus a form element onload

The Personalised Plates website has a big input box on every page for searching for available personalised plates. The page template uses the Javascript form element focus() function to set the focus on this text box when the page loads so the user can start to type in a personalised plate idea without having to click the box with their mouse.