开发者

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=?",
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜