Created
July 17, 2013 15:36
-
-
Save thePunderWoman/6021713 to your computer and use it in GitHub Desktop.
AddThis to block ie8
This file contains hidden or 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 Button BEGIN --> | |
<div class="addthis_toolbox addthis_default_style addthis_32x32_style"> | |
<a class="addthis_button_email"></a> | |
<a class="addthis_button_facebook"></a> | |
<a class="addthis_button_twitter"></a> | |
<a class="addthis_button_google_plusone_share"></a> | |
<a class="addthis_button_compact"></a><a class="addthis_counter addthis_bubble_style"></a> | |
</div> | |
<script> | |
function loadScript(url, callback) { | |
var script = document.createElement("script") | |
script.type = "text/javascript"; | |
if (script.readyState) { //IE | |
script.onreadystatechange = function () { | |
if (script.readyState == "loaded" || | |
script.readyState == "complete") { | |
script.onreadystatechange = null; | |
callback(); | |
} | |
}; | |
} else { //Others | |
script.onload = function () { | |
callback(); | |
}; | |
} | |
script.src = url; | |
document.getElementsByTagName("head")[0].appendChild(script); | |
} | |
if (!$('html').hasClass('ie8')) { | |
loadScript('//s7.addthis.com/js/300/addthis_widget.js#pubid=xa-51e6b48a509222f7','') | |
} | |
</script> | |
<!-- AddThis Button END --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment