javascript - Check to see if AddThis is loaded, then trigger a link banner? -


i'm looking load banner once addthis loads on page, or when becomes viewable. unfortunately, i've tried has failed. tried suggested code site, hasn't worked, throws referenceerror, , not sure try next.

here's code site:

// alert message when addthis api ready function addthisready(evt) {     alert('addthis api loaded.'); }  // listen ready event addthis.addeventlistener('addthis.ready', addthisready); 

here's link page: addthis javascript events

tanel right. problem addthis object has not been initialized before calling. here's simple solution, used website:

var addthistimer = setinterval( function() {     if ( typeof addthis !== 'undefined' ) {         clearinterval( addthistimer );         addthis.addeventlistener( 'addthis.ready', function() {             console.log('addthis api loaded.');         });     } }, 100 ); 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -