Essentially, my current setup involves utilizing a JavaScript Library that includes the following code within a function:
var img = new Image(); // Creating a new img element
img.src = 'URL/myImage.png'; // Setting the source path
This results in multiple HTTP GET requests being sent to the server (visible in Firefox's Developer Console > Network, with their type displayed as 'img' under the 'Cause' column).
Is there a way for me to detect events such as when the image starts loading and when it has finished loading based on the above code, all within my index.html file using the JavaScript library (I am unable to modify the library)?