function preloadImage(url, callback) { var url ="images/load.jpg"; var img=new Image(); img.src=url; img.onload = callback; }