I'm trying to reduce the amount of consumed traffic. That's why I have to cancel loading of unnecessary images. As I'm trying to cancel loading of few images, not all, so I can't use method
window.stop();
I was trying to replace SRC of unnecessary images to empty string value
img.src = '';
But it works just in Chrome and Opera and still trying to load at least part of the image (few kb of the whole image size). This is not a solution, but still it helps to reduce the amount of consumed traffic. But this solution is not good for Firefox and Safari. Also I was trying to change
img.src = '1px.png';
with a small size (1kb or less) but it is still not a solution.
Also I tried to remove element from HTML.
img.parentNode.removeChild(img);
Is there any effective solution that works in all browsers and completely canceled the image loading?