This maybe a real stupid question so I apologise and i stand ready to delete my own question.
I have an image element in my HTML5 app to which i give an id of 'img1' like so:
<img id="img1" src="" /`>
I assign a module variable to this element like so:
var staticImgArray = document.getElementById('img1');
I set the image src by binding it to a Generic handler (I am using ASP.NET)
staticImgArray .src = 'get image from this link';
Now I need to know at what point has the image finished loading. At the moment I use this code to determine that:
staticImgArray.onload = function () {
//image has loaded
};
staticImgArray.onerror = function () {
//image has not loaded properly but has finished trying?
};
But...
staticImgArray.src = 'get image from this link';
**//image has finished loading here..??**
//other code runs here afterwards
...if the above statement is not true then does that not imply the loading of the image is done asynchronously?
Thanks