I’m loading an external script through .load('url') and need to wait for it to finish so I can update the source of an image. Sometimes load is fast enough that the image reload applies, but most of the time it takes too long and the image reload happens first, so the image doesn’t actually change.
I’m loading an external script through .load(‘url’) and need to wait for it to
Share
Add a callback function:
More to read at http://api.jquery.com/load