Jquery ajax with facebook social graph json -


I am trying to create a feed using jquery AJAX and using the Jason method, data from Facebook's social graph I am requesting.

Can anyone tell me why he is not doing the job? I have tried $ GetJSON (); No luck!

This is the code that I have just tested and still no luck:

  $ (document) .ready (function () {var url = " Http://graph.facebook.com/prettyklicks/feed?limit=3&callback=?pk "; $ .getJSON (url, function (jsn) {var html =" 
    "; $ EEC (JasonAdata, Function (I, FB) {html + = "
  • " + fb.message + "";}); Html + = "& lt; / Ul & gt; "$$ ('facebookfeed'). Html (html);});});

You are close, just remove 'pk' from json url, give jquery for you Provide the name of the callback:

  $ (document) .ready (function () {var url = "http://graph.facebook.com/prettyklicks/feed?limit= 3 & amp; ; Callback =? "; $ .getJSON (url, function (jsn) {var html =" & lt; ul & gt; "; $ .EEEE (JasonAdata, function (I, FB) {html + =" & lt; Li & gt;; + + Fb.message + "& lt; / li & gt;";}); html + "" & lt; / ul> "$ $ ('facebookfeed'). Html (html) ;});});  

The SAC is correct with your answer, you need to use JSON-P but if you have a If you drag JSON from a different domain, then jQuery will automatically take care of it for you.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -