I am developing a facebook app. I am trying to get the likes for urls as I am iterating through an array of urls and adding it to the div that should contain the likes. This is my ajax request:
$.ajax({
type: "GET",
cache: false,
url: 'https://graph.facebook.com/?id='+videoUrl,
dataType : "json",
async: false,
header: "application/json",
success: function(data) {
if(data.shares == null) {
likeCount = 0;
} else {
likeCount = data.shares;
}
}
});
This works perfectly fine on Chrome, Firefox, Safari. It doesn't work on any IE. I thought it was a caching issue. Notice that I added cache: false to the request. I tried JSONP and I get the likes but I am unable to access it outside of the request. I also tried adding this to my php:
header("Cache-Control: post-check=0, pre-check=0", false);
It still doesn't work. Please help me!