I thought I’d start a new Category called “Toolbox”, specifically for what I use on a daily basis for web development. These are snippets, functions, cheats, etc that anyone can use and make my life as a web developer that much easier…
This installment is something I’ve been using lately to preload images so they don’t spit out the alt text…Mostly it seems to happen when I’m doing something with ajax.
I found this snippet at Matt Farina’s blog.
This is the code (I just made a js file out of it and include it when necessary).
jQuery.preloadImages = function()
{
for(var i = 0; i<arguments.length;i++) {
jQuery("<img>").attr("src", arguments[i]);
}
}
