Many users use dynamic Html or Ajax to display content on scrolling which loads the content without navigating to another page. Addthis code should runs on page load it is not working when I load dynamic content on button click.
<div class="addthis_toolboxaddthis_default_style ">
<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_counteraddthis_bubble_style"></a>
</div>
After adding this following script on page load it is showing the addthis toolbox.
$(document).ajaxStop(function () {
if (window.addthis) {
window.addthis = null;
}
var addthisScript = document.createElement('script');
addthisScript.setAttribute('src', 'http://s7.addthis.com/js/300/addthis_widget.js#domready=1')
document.body.appendChild(addthisScript);
var addthis_config = addthis_config || {};
addthis_config.pubid = 'publisherId'; // include publisherid fromaddthis.com });
Post your comments / questions
Recent Article
- How to restrict access to the page Access only for logged user in Django
- Migration admin.0001_initial is applied before its dependency admin.0001_initial on database default
- Add or change a related_name argument to the definition for 'auth.User.groups' or 'DriverUser.groups'. -Django ERROR
- Addition of two numbers in django python
- The request was aborted: Could not create SSL/TLS secure channel -Error in Asp.net
- FieldError: Cannot resolve keyword 'id' into field in Django project
- How to hide the ID field from the Django admin?
- It is impossible to add a non nullable field without specifying a default. Django error
Related Article