Javascript 异步脚本加载回调

Javascript 异步脚本加载回调,javascript,jquery-callback,Javascript,Jquery Callback,我正在使用他们的示例脚本加载Google Hangouts按钮: // Load Hangouts Buttons Async window.___gcfg = { lang: 'en', parsetags: 'onload' }; (function() { // Load script var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;

我正在使用他们的示例脚本加载Google Hangouts按钮:

// Load Hangouts Buttons Async
window.___gcfg = {
  lang: 'en',
  parsetags: 'onload'
};
(function() {

    // Load script
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);

})();

我使用spin.JS设置了一个微调器,我想在Hangouts脚本加载时停止/隐藏它。如何将回调插入上述加载函数?

您需要为脚本标记钩住onload事件。请看这里: