Hi guys!
I have a modal dialog on my website that provides share functionality for a certain resource. I can get AddThis to load/work when the first dialog has opened. Future dialogs show no buttons, but an empty counter.
How do I make AddThis work with dynamic content? I have tried multiple things, and Googled intensively:
HTML:
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url="{{url}}" addthis:title="{{title}}" addthis:description="{{description}}">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
First try:
// Prevent jQuery from appending cache busting string to the end of the URL.
var cache = $.ajaxSettings.cache;
$.ajaxSettings.cache = true;
$.getScript('http://s7.addthis.com/js/250/addthis_widget.js#pubid=sdive&domready=1', function() {
if (window.addthis){
window.addthis.ost = 0;
window.addthis.ready();
}
});
// Restore jQuery caching setting.
$.ajaxSettings.cache = cache;
// Second try:
if (window.addthis) {
window.addthis.ost = 0;
window.addthis.ready();
}
$.getScript('http://s7.addthis.com/js/250/addthis_widget.js#pubid=sdive&domready=1', function() {
window.addthis.init();
});
Third try:
if (window.addthis) window.addthis = null;
$.getScript('http://s7.addthis.com/js/250/addthis_widget.js#pubid=sdive&domready=1', function() {
window.addthis.init();
});
Nothing works. Any help?
This question is closed to new answers.