0

I'm having this situation. In my FB.api call, a unknown JSON object was returned to me. I'm trying to figure out how to look into this JSON object!

FB.api('/me/feed', 'post', wallPost , function(response) {
            if (!response || response.error) {
              alert('Error occured' + response);
            } else {
              alert('Post ID: ' + response);
            }
        });
tommi
  • 6,883
  • 8
  • 37
  • 60

5 Answers5

1

Download firebug for firefox and put a breakpoint in that function and then hover over that variable and firebug should show you all of its properties and objects. Or use Chromes console to do the same thing

Keith.Abramo
  • 6,952
  • 2
  • 32
  • 46
0

Try console.log(response) instead of alert. Then check the firebug console.

jakber
  • 3,549
  • 20
  • 20
0

If you have firebug installed, do:

console.log(response);

Then you can debug the structure of the JSON object using Firebug from the console-tab.

Chris
  • 8,031
  • 10
  • 41
  • 67
0

Just do a console.log of the data. You can also iterate over its keys to look at each entry individually, or if you know some of them, just pick out those.

Dave Newton
  • 158,873
  • 26
  • 254
  • 302
0

Remember to remove that console.log command after you tested your code. Browser with no support for this will complain.

Bao Nhan
  • 180
  • 7