Jump to content

Ajax loaded page doesnt show sharethis buttons


yandoo

Recommended Posts

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 :)

  • 2 weeks later...

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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.