im working on a Website where you can browse through images rapidly by pressing a key, so i've got the Javascript and everything set up (It simply rewrites a div with .innerHTML to display a new image)
However, if you press the key a few times, it loads up each image even if its not required anymore. This delays the loading of the image the user actually wants to see, so the site slows down (and traffic is used inefficiently etc etc)
It looks like this in the Chrome inspector:
https://i.stack.imgur.com/IkzEC.png
While it could actually cut off the current GET operator because the old image isn't required anymore.
Is there any way to interrupt it? If possible without using a completely different technic to load the images up (AJAX)
Thanks in advance!
Edit: Crazy Train's idea with iframes works! Thank you!