{"id":5717,"date":"2014-04-06T10:29:06","date_gmt":"2014-04-06T10:29:06","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/06\/addthis-wordpress-plugin-not-working-with-ajax-theme-collection-of-common-programming-errors\/"},"modified":"2014-04-06T10:29:06","modified_gmt":"2014-04-06T10:29:06","slug":"addthis-wordpress-plugin-not-working-with-ajax-theme-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/06\/addthis-wordpress-plugin-not-working-with-ajax-theme-collection-of-common-programming-errors\/","title":{"rendered":"AddThis WordPress plugin not working with AJAX theme-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m using the AddThis WordPress plugin to include share buttons underneath each post in an AJAX theme, and am having trouble getting the code right. Here is the website in question: http:\/\/www.jaesonma.net\/<\/p>\n<p>I inserted the following code in the custom button field on the settings page:<\/p>\n<pre><code>\n    \n    \n    \n    \n    \n\n<\/code><\/pre>\n<p>Then in the post loop in the main page PHP file I have this:<\/p>\n<pre><code>\n    var tbx = document.getElementById(\"toolbox\"),\n    svcs = {email: 'Email', print: 'Print', facebook: 'Facebook', expanded: 'More'};\n\n    for (var s in svcs) {\n        tbx.innerHTML += ''+svcs[s]+'';\n    });\n\n    function ReinitializeAddThis() {\n        if (window.addthis) {\n            window.addthis.toolbox(\"#toolbox\");\n        }\n    }\n\n\n<\/code><\/pre>\n<p>The buttons will only load sporadically, and disappear after a refresh. I&#8217;m also getting the error <em>Uncaught ReferenceError: ReinitializeAddThis is not defined<\/em> which is confusing&#8230; I&#8217;d really appreciate any insight and I apologize if anything is unclear. Thanks!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m using the AddThis WordPress plugin to include share buttons underneath each post in an AJAX theme, and am having trouble getting the code right. Here is the website in question: http:\/\/www.jaesonma.net\/ I inserted the following code in the custom button field on the settings page: Then in the post loop in the main page [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5717","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5717","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5717"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5717\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5717"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5717"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5717"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}