GET request failed while using $.getJSON on facebook Graph Api
this is a a part of a PHP file. its a facebook app hosted in Heroku.
The GET request is always failed although im using a valid access token. (callback function never invoked). What is wrong?
<body>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/j开发者_如何学Pythonquery.min.js"> </script>
<script>
$(document).ready(function()
{
$.getJSON("https://graph.facebook.com/me/likes?access_token=<?php echo $token; ?>&limit=4",
function(json) {
alert("JSON Data: " + json.data[0].id);
});
});
</script>
Restriction of Same origin policy. You can't do this. Append &callback=?
" to that URL
$.getJSON("https://graph.facebook.com/me/likes?access_token=<?php echo $token; ?>&limit=4&callback=?",
精彩评论