Hi Guys,
var img1 = document.querySelector('.img-1');
img1.addEventListener('load', function() {
// woo yey image loaded
});
img1.addEventListener('error', function() {
// argh everything's broken
});
According to the example above is there any possibility to happened the event before we started listening for them.
I got this problem when I read this
Javascript Promises