Computing desk | ||
---|---|---|
< May 5 | << Apr | May | Jun >> | May 7 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
Hi, Recently I added AddThis share buttons on my blog. And they went suddenly disappeared one day. When I contacted their support team, they told that it's due to a Javascript error. Also, they sent me a screenshot. There I could see an error named Uncaught ReferenceError: __adroll is not defined. I've searched a lot on net to find a solution to fix this. But couldn't find one. Can anyone help me out to fix this?--Joseph 03:22, 6 May 2014 (UTC)
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5358bd9112b31987"></script>
<script type='text/javascript'>
var addthis_product = "blg";
document.doAT = function(cl)
{
var myclass = new RegExp('hentry');
var myTitleContainer = new RegExp('post-title');
var myPostContent = new RegExp('post-footer');
var elem = this.getElementsByTagName('div');
var url;
var title = "";
for (var i = 0; i < elem.length; i++)
{
var classes = elem[i].className;
if (myclass.test(classes))
{
var container = elem[i];
url = window.location.href;
for (var b = 0; b < container.childNodes.length; b++)
{
var item = container.childNodes[b].className;
if (myTitleContainer.test(item))
{
var link = container.childNodes[b].getElementsByTagName('a');
if (typeof(link[0]) != 'undefined')
{
var url = link[0].href;
var title = link[0].innerHTML;
}
var singleq = new RegExp("'", 'g');
var doubleq = new RegExp('"', 'g');
title = title.replace(singleq, ''', 'gi');
title = title.replace(doubleq, '"', 'gi');
}
if (myPostContent.test(item))
{
var footer = container.childNodes[b];
}
}
var n = document.createElement('div');
var at = "<div class='addthis_toolbox addthis_default_style addthis_32x32_style' addthis:title='"+title+"' addthis:url='"+encodeURI(url)+"' >
<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_counter addthis_bubble_style'></a> </div> ";
n.innerHTML = at;
container.insertBefore(n , footer);
}
}
return true;
};
document.doAT('hentry');
</script>
And this is my blog. What all more details should I provide you?--Joseph 11:48, 6 May 2014 (UTC)
var myclass = new RegExp('hentry');
to var myclass = new RegExp('h-entry');
as their seems to be an incompatibility with you blogspot page and the code addthis is expecting. Is you software upto date?