Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sharethis button does not work on pages loaded via ajax

Tags:

sharethis

I am trying to use the sharethis button on a page which is loaded via ajax. The buttons do not show up. Please help.

Regards, Pankaj

like image 984
Pankaj Avatar asked Sep 22 '10 10:09

Pankaj


2 Answers

After adding the new content to the dom, call

stButtons.locateElements();

// or if you want to be a bit defensive about whether the lib has been
// loaded or not:
if (window.stButtons){stButtons.locateElements();} // Parse ShareThis markup

Article another another

like image 74
Larry K Avatar answered Oct 03 '22 23:10

Larry K


Updated 09/2017 Answer

The stButtons object doesn't exist anymore, now you can use

window.__sharethis__.initialize()

To reinitialize the buttons

like image 21
The Ape Avatar answered Sep 29 '22 23:09

The Ape