yandoo Posted January 13, 2013 Share Posted January 13, 2013 (edited) I have an ajax loaded page that when loaded doesnt show the sharethis buttons. If the page is tested independently the buttons work fine, its just when the ajax page is loaded into the <div> content area of the main page that the buttons dont show up. Main page with ajax call function: <head> <script type='text/javascript'> function updateAcupuncture() { var objXmlHttp; if (window.XMLHttpRequest) { objXmlHttp =new XMLHttpRequest(); } else { // for IE5 and IE6 we use ActiveX objXmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } objXmlHttp.onreadystatechange=function() { // the AJAX call has returned if ((objXmlHttp.readyState==4) && (objXmlHttp.status==200)) { document.getElementById("contentArea").innerHTML=objXmlHttp.responseText; } } objXmlHttp.open("GET","acupuncture.html",true); objXmlHttp.send(); } </script> </head> <body> <div id ="contentArea"></div> </body> Page with sharethis buttons that dont work when called into the content are <div> <head> <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script> <script type="text/javascript">stLight.options({publisher: "168fe05d-a490-44f1-91b8-e1f5c9cb131d", shorten:false});</script> </head> <body> <span class='st_facebook_hcount' displayText='Facebook' st_url="#" st_title="It's all about Something" st_image="#"></span> </body> Please help Edited January 13, 2013 by yandoo Quote Link to comment https://forums.phpfreaks.com/topic/273098-ajax-loaded-page-doesnt-show-sharethis-buttons/ Share on other sites More sharing options...
wright67uk Posted January 21, 2013 Share Posted January 21, 2013 Won't you end up with two <head> areas? Quote Link to comment https://forums.phpfreaks.com/topic/273098-ajax-loaded-page-doesnt-show-sharethis-buttons/#findComment-1407222 Share on other sites More sharing options...
P5system Posted February 1, 2013 Share Posted February 1, 2013 On Ajax Page call only buttons the head and body are coming two times. we wont need it. You can directly call javascript and <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script> <script type="text/javascript">stLight.options({publisher: "168fe05d-a490-44f1-91b8-e1f5c9cb131d", shorten:false});</script> <span class='st_facebook_hcount' displayText='Facebook' st_url="#" st_title="It's all about Something" st_image="#"></span> Quote Link to comment https://forums.phpfreaks.com/topic/273098-ajax-loaded-page-doesnt-show-sharethis-buttons/#findComment-1409486 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.