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
.load(\'url\')
Add a callback function:
$('#yourElement').load('yourUrl.html', function() { /* When load is done */ });
More to read at http://api.jquery.com/load