Be careful when using XHR for downloading js code. Firefox does not cache any data when using XHR and therefore the old school method (as explained by Michael above) is usually better.