xmlhttprequest .
var url = "image.php?sleep=3";
var img = new Image;
var sjax = new XMLHttpRequest();
img.src = url;
sjax.open("GET", url, false);
sjax.send(null);
alert(img.complete);
, Image, ajax . Image , , . , ajax , . , Image.
This assumes the image is served with HTTP caching headers. Otherwise, this behavior may vary across browsers.
source
share