D
D
DenimTornado2014-02-27 15:28:50
JavaScript
DenimTornado, 2014-02-27 15:28:50

How to cut off the process of waiting for sending a request for an image or a script?

There is a mobile version of the site, there are counters, there are pictures from third-party services. The question is, how to cut off the request process in JS? Here is the same waiting .
gtrpe_mjd-MJ7KUnTspvAfDHnF3Ogpb0FX_28sMJ
The point is to chop off non-critical things if they don't give up for too long.
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Grigory Peretyaka, 2014-02-27
@DenimTornado

To chop off the request, simply remove the image from the DOM.
With jQuery:
You also need to know if it loaded, jQuery has $.load() for that.
This can also be done in native JS, it’s easy to google, I don’t remember from memory.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question