Created
March 15, 2012 16:01
-
-
Save stenvdb/2044958 to your computer and use it in GitHub Desktop.
JavaScript: Init AddThis Ajax
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
// Init addthis | |
if (addThisFirstLoad) { | |
var script = 'http://s7.addthis.com/js/250/addthis_widget.js#domready=1'; | |
if (window.addthis){ | |
window.addthis = null; | |
} | |
$.getScript( script, function(){ addthis.init(); } ); | |
addThisFirstLoad = false; | |
} else { | |
// Update the buttons (and dont download the script twice) | |
//var title = "New title!"; | |
addthis.ost = 0; | |
addthis.update('share', 'url', window.location.href); | |
//addthis.update('share', 'title', title); | |
addthis.ready(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment