I've just implemented an FB.ui 'send' call. I process the returned value in the callback function and, not finding any documented reference, I wonder if I can investigate what's inside this 'response' JSON object. In PHP it is fine but I'm in JavaScript and I just want to process in the client, not additional server calls. Right now I can just say that 'response' is 'null' or not. How can I find it's set of 'response.value' or some kind of de-serialization of the object in a string? Thanks
1 Answer
Have you installed Firebug (if you use Firefox) or do you use Chrome? I believe if you call console.log
with your object, it will allow you to inspect its structure in the Firebug Console Log. In Chrome, it will be logged in its Console Log.
Here is a good tutorial with more detail on using console.log.
-
Thanks for the hint. I'm using Chrome but no idea how to use the console. I have Firefox Aurora and Firebug is not yet developed for this version. Your answer will put me at work anyway with this respect, however isn't it the 'response' structure documented somewhere in the Graph API?Ginger Opariti– Ginger Opariti11/22/2011 15:53:13Commented Nov 22, 2011 at 15:53
-
In Chrome, go to View > Developer > Javascript Console. When you call
console.log(myObject)
, it should show the inspectable object structure in this console. Re: response objects, they vary depending on what API call you make. FB is not so good at documenting it. That's why it's easier to use console.log to see for yourself.scham– scham11/22/2011 16:03:37Commented Nov 22, 2011 at 16:03 -
I just did it and I'll mark your response as answer. I've got just the values that I've guessed already, ie 'null' and '[]'. I've asked the question because "somewhere" in a past comment, before the new Graph API release, it was some kind of more elaborated JSON object. That's why I was looking for documentation related support. Thanks againGinger Opariti– Ginger Opariti11/22/2011 16:08:00Commented Nov 22, 2011 at 16:08