jQuery: how to know when an external JS has finished?

Posted by andufo on Stack Overflow See other posts from Stack Overflow or by andufo
Published on 2010-05-22T00:33:47Z Indexed on 2010/05/22 0:40 UTC
Read the original article Hit count: 318

Hi, i need to execute specific javascript instructions AFTER an external javascript finishes its own process.

(function(){
    var dsq = document.createElement('script');
    dsq.type = 'text/javascript'; dsq.async = true;
    dsq.src = 'http://xxxxxxxx.disqus.com/embed.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();

How can jQuery know when that .js has finished doing what it does?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about javascript-events