Rebuilding addThis on ajax/pushstate update

loydall May 23, 2012 10:26AM EDT

Hi - I am only updating parts of my page and updating the URL using pushstate. I have an addThis component on my page that I need to update with each new ajax page/content load.

I have this working to a point but the only problem is, each time I initialise my addThis component, it adds script and css references to my page. This means it builds up references to, for example, http://s7.addthis.com/static/r07/core013.js - if I navigate through 8 pages of AJAX loaded content, I get 8 references to that js file in my header (along with other addThis files).

Any way to prevent this?

Up 0 Rated Down
Paul (AddThis Happiness Specialist) May 23, 2012 11:48AM EDT
You should only have to initialize AddThis once. Then, when you want to re-render the toolbox, call the addthis.toolbox() function. More information is available in our client API: http://support.addthis.com/customer/portal/articles/381263-addthis-client-api

This question is closed to new answers.

Still need help?


General Topics

 

Developers