What is a better way to pre-load images:
$.each(['{{ MEDIA_URL }}jwplayer/jwplayer.js', '{{ MEDIA_URL }}jwplayer/jwplayer.js.jgz', '{{ MEDIA_URL }}jwplayer/player.swf'], function() { $('<img/>')[0].src = this; or:
var preloadImages = ['{{ MEDIA_URL }}jwplayer/jwplayer.js', '{{ MEDIA_URL }}jwplayer/jwplayer.js.jgz', '{{ MEDIA_URL }}jwplayer/player.swf']; var imgs = []; for (var i=0; i<preloadImages.length; i++) { imgs[i] = new Image(); imgs[i].src = preloadImages[i]; } What makes one better than the other?