Skip to content

Instantly share code, notes, and snippets.

@marcobeltempo
Last active January 6, 2018 01:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcobeltempo/36a13892bc4bd055d269a74a5e261dc6 to your computer and use it in GitHub Desktop.
Save marcobeltempo/36a13892bc4bd055d269a74a5e261dc6 to your computer and use it in GitHub Desktop.
Lab 11 Test Case Example
var img = document.querySelector('#image-1234');
img.onload = function loaded() {
...
};
img.src = "http://some.url.com/image";
...
//Somewhere late in the code I set the URL to the same thing again
img.src = "http://some.url.com/image";
//I'd expect the onLoad event to fire a second time, but it doesn't always in this case!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment