// preloading function for arbitrary content (which usually contains images) jQuery.preloadContent = function(){ for(var i = 0; i").html(arguments[i]); } }; // use like (myvar being a JS variable with content to preload) $.preloadContent(myvar1, myvar2); //javascript/3933