开发者

GET request failed while using $.getJSON on facebook Graph Api

开发者 https://www.devze.com 2023-04-11 09:17 出处:网络
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.

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

精彩评论

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