How can I determine if an image has loaded, using Javascript/jQuery?

Either add an event listener, or have the image announce itself with onload. Then figure out the dimensions from there.

<img id="photo"
     onload='loaded(this.id)'
     src="https://stackoverflow.com/questions/263359/a_really_big_file.jpg"
     alt="this is some alt text"
     title="this is some title text" />

Leave a Comment