if i use jQuery syntax : $("<img src='img.jpg'>") , will the image actually be downloaded to the client? or do i have to append it to body in order to download it?
if i use jQuery syntax : $(<img src=’img.jpg’>) , will the image actually be
Share
You don’t have to add the image element to the document for the image to be loaded.
The image element itself will request the image as soon as you create it (and as soon as it has a
srcvalue).Watch the net acivity (in Firebug/Developer Tools) when you run this: http://jsfiddle.net/Guffa/AvgVN/
Google “javascript preload” to find tons of code examples that uses this.