Jump to content


Photo

Ajax loaded page doesnt show sharethis buttons


  • Please log in to reply
2 replies to this topic

#1 yandoo

yandoo

    Advanced Member

  • Members
  • PipPipPip
  • 470 posts

Posted 13 January 2013 - 12:03 PM

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, 13 January 2013 - 12:06 PM.


#2 wright67uk

wright67uk

    Advanced Member

  • Members
  • PipPipPip
  • 438 posts

Posted 21 January 2013 - 04:16 AM

Won't you end up with two <head> areas?


#3 P5system

P5system

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts
  • LocationUSA

Posted 01 February 2013 - 07:50 AM

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.c...s.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>

If you like my reply please click on https://plus.google....w.p5systems.com to approve it.


Thanks,
P5 Systems
http://www.p5systems.com/





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com