function preloadImage(url) { (new Image()).src = url; } $(document).ready(function() { preloadImage('images/myimg.jpg'); });
Programming Tips - jQuery: preload an image
Date: 2012jul4
Updated: 2019jan8
Language: javaScript
Platform: web
Q. jQuery: preload an image
A. Create and use an Image object in your ready() function: