Possible duplicate:Javascript: Cancel / stop image requests
How to abort an image request that is still on the fly?
Example:
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)
In Firefox, setting the src image to an empty string cancels any active request.
src
Once the browser sends a request for a captured image, you cannot cancel it.
In most cases, you can hide the image element in this case or show a friendly message.
Source: https://habr.com/ru/post/1332995/More articles:In java, how do I edit 1 line of a text file? - javaAccess to array elements - c ++MVVMLight - Passing a parameter to a ViewModel constructor? - dependency-injectionHow important is it to use short names for Python packages and modules? - pythonhelp - sed - insert a space between any line of the XxxXxx form without replacing the template - unixHow to determine if PEAR package is installed in php scripts? - phpUsing JRE 1.5, still maven says annotation is not supported in -source 1.3 - javaCreating an enum / class from a database table - c #Understanding the imperative list example in Ocaml - ocamlC / C ++ Is there any cross-paid way to use relative paths? - c ++All Articles