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 get domain name information from a Domain using Python
- ModulenotFoundError: no module named 'debug_toolbar' -SOLUTION
- How to create superuser in django project hosted in cPanel without terminal
- CSS & images not loading in django admin | cpanel without terminal
- Could not build wheels for mysqlclient, which is required to install pyproject.toml-based projects
- How to sell domain name on Godaddy (2023)
- TemplateSyntaxError at / Could not parse the remainder: ' + 1' from 'forloop.counter0 + 1'
- urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.0
Related Article