1

I'm loading a Google Hangouts button using their example script:

// 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);

})();

I setup a spinner using spin.JS and I want to stop/hide it when the Hangouts script loads. How do I insert a callback into the above loading function?

OdieO
  • 6,836
  • 7
  • 56
  • 88
  • You'll need to hook the onload event for your script tag. Have a look here: http://stackoverflow.com/questions/16230886/trying-to-fire-onload-event-on-script-tag – Frank van Puffelen Aug 13 '14 at 18:04

0 Answers0