I have the following code
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
</head>
<body>
<button id="btn1">Get JSON data</button>
<div></div>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script>
$(document).ready(function(){
$.support.cors = true;
$("#btn1").click(function(){
//$.getJSON("https://graph.facebook.com/LavanReddy",function(result,textStatus,jqXHR){
// $.each(result, function(key, value){
// $("div").append(key+": "+value+"<br />");
// });
//}).fail(function(xhr, status, error)
//{
// alert('Error: ' + status + '\nError Text: ' + error + '\nResponse Text: ' + xhr.responseText);
//});
$.ajax({
type: 'GET',
url: 'https://graph.facebook.com/LavanReddy',
contentType: "application/json; charset=utf-8",
dataType: 'json',
success: function(result) {
$.each(result, function(key, value) {
$("div").append(key+": "+value+"<br />");
});
},
error: function(xhr, status, error) {
alert('Error: ' + status + '\nError Text: ' + error + '\nResponse Text: ' + xhr.responseText);
}
});
});
});
</script>
</body>
</html>
I tried using both getJSON as well as Ajax (no luck). It works correctly on all browsers in local. But on server it works only on chrome, firefox and IE10 but not on IE8 or IE9 Plz help