I am following a tutorial to implement social share count buttons like the user in this post. I've sent the correct http request for get_social_counts.php, but it's still not working.
The buttons load correctly and I can share the page, but the count is not displayed. I have used the exact same HTML as in the tutorial. It also doesn't work on a remote server.
Here is the JavaScript function:
function get_social_counts() {
var thisUrl = window.location.protocol + "//" + window.location.host + window.location.pathname;
$.ajax({
type: "GET",
url: 'http://localhost:1234/site/php/get_social_counts.php?thisurl='+thisUrl,
dataType: "json",
success: function (data){
$('a.post-share.twitter span').html(data.twitter);
$('a.post-share.facebook span').html(data.facebook);
$('a.post-share.gplus span').html(data.gplus);
$('a.post-share.stumble span').html(data.stumble);
}
});
}