Last active
January 3, 2016 15:09
-
-
Save elzii/8480658 to your computer and use it in GitHub Desktop.
addthis ajax fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Addthis JS Fix | |
-------------- | |
Assumes content lives in partial/content that is being loaded by an AJAX call | |
*/ | |
// set addthos_config obj | |
var addthis_config = addthis_config||{}; | |
// set the pubid to config obj | |
addthis_config.pubid = '__YOUR_PUBID__'; | |
// clear properties in addthis obj | |
if (window.addthis) { | |
window.addthis = null; | |
window._adr = null; | |
window._atc = null; | |
window._atd = null; | |
window._ate = null; | |
window._atr = null; | |
window._atw = null | |
} | |
// use jQ to get script externally | |
jQuery.getScript( "https://s7.addthis.com/js/300/addthis_widget.js") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment