Load Javascript files asynchronously

It’s annoying when a web page is loading and gets stuck downloading a Javascript file from a remote domain. Until the file has downloaded, rendering on the page stalls which could potentially lose you traffic as people give up waiting. Instead it’s a good idea to load the remote Javascript asynchronously so the page can continue to render and the code is downloaded in the background.

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.