Return to Snippet

Revision: 22498
at January 13, 2010 12:47 by 1man


Initial Code
(function($){
	$(window).load(function(){
		//Wait for the page to load, the cache the files you want
		$.ajax({url:'javascript.js', dataType:'text'});
		$.ajax({url:'image.jpg', dataType:'text'});
		$.ajax({url:'flash.swf', dataType:'text'});
		$.ajax({url:'style.css', dataType:'text'});
	});
})(jQuery);

Initial URL


Initial Description
Handy little snippet i found in 'jquery enlightenment' for caching certain selected files. Could be useful for larger files later on in a site.

Initial Title
Cache files with jQuery and ajax method

Initial Tags
ajax, jquery, cache

Initial Language
jQuery