(Pre-emptive strike: If you\'re tempted to mark this as a duplicate, note that other questions seem to ask \"why am I getting this error?\" I know why I\'m getting this erro
It appears that when changing the src attribute of the img tag, Firefox fires a load event. This is contrary to the HTML5 specification, which says that if the src attribute is changed, then any other fetch already in progress should be ended (which Firefox does), and no events should be sent. The load event should be sent only if the fetch was completed successfully. So I'd say that the fact that you get a load event is a Firefox bug.
However, the image should know if it is fully available or not, you could try to use the complete attribute:
if (this.complete === false) {
return;
}
Unfortunately, Firefox has this.complete set to true instead, so that's not an option either.
The best option may be to create a new element each time you wish to change the src attribute.