可能是重复问题:
Javascript:取消/停止图像请求
如何中止仍在进行中的图像请求?
示例:
var img = new Image();
var img.src = "http://www.google.co.in/images/nav_logo29.png";
window.setTimeout(function(){
//Code to abort/cancel image request if it hasn't triggered onload or onerror even after 20 seconds of sending request.
},20000)