Jump to content

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

Edited by yandoo
  • 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>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.