Is it possible to stop the download of specific Javascript kartinki

0 like 0 dislike
4 views
Science fiction of course, but suddenly...
It is clear that it is possible to stop loading the whole page stop() and then all the load will also fall off,
but it's not what you need, you need to say to stop a particular picture if it is too long time to boot.

A solution is found.
Here the author paaashka
Really helped to bring our script to perfection.
I spent a lot of time but finished it, in pure JS
by | 4 views

6 Answers

0 like 0 dislike
And if the pictures dynamically create iframe with it, and if the event came from iframe that the picture is loaded, then remove ifram together with the picture? Now I tried deleting iframe, download the image stops.
by
0 like 0 dislike
You can try two options.
\r
First, the obvious, something to do with the image (img), change the src attribute, convert it to some other tag. But most likely it's not working, why you ask.
\r
Second, the theoretically possible option. To do an ajax request to the desired picture and at the right time to call the abort method of the XMLHttpRequest object (for example, the jQuery function $.ajax returns a similar object). Thus, if we assume that the browser will cache the queries, the picture may be in the cache in case of successful execution. It should be checked.
by
0 like 0 dislike
From the pictures there is an event "onabort". Maybe try to tigeryouth( img.fireEvent("abort"))?
by
0 like 0 dislike
Function loadedImg removes the downloaded img from the array is still idle.
Half a minute later, unloaded all the images src is changed, thereby stopping the download
\r
var notLoadedImgs = $('img'); $('img').load(function() {loadedImg(this);}); // img loadedImg excludes from notLoadedImgs setTimeout(function() { $(notLoadedImgs).attr('src', '404'); }, 30000); 
by
0 like 0 dislike
$('img').execCommand("Stop", false); 

can you?
by
0 like 0 dislike
And try not to change the src, and generally to clean it up removeAttr('src')
by

Related questions

0 like 0 dislike
3 answers
asked Apr 9, 2019 by AntonVirovets
0 like 0 dislike
2 answers
0 like 0 dislike
3 answers
110,608 questions
257,186 answers
0 comments
28,888 users