Hi, I would like to see the structure of object in JavaScript (for debugging). Is there anything similar to var_dump in PHP? Thanks
+7
A:
Install Firebug
for Firefox and do this:
console.log(myvar);
Then you will get a nicely mapped out interface of the object/whatever in the console.
Check out the console
documentation for more details.
Paolo Bergantino
2009-03-02 21:05:54
thanks, i use Firebug but i didn't know about this feature. also thanks for link.
perfectDay
2009-03-02 21:50:29
+3
A:
Please check out this post: "jQuery: print_r() display equivalent?"
zodeus
2009-03-02 21:07:01
+3
A:
Then, in your javascript:
var blah = {something: 'hi', another: 'noway'};
console.debug("Here is blah: %o", blah);
Now you can look at the console, click on the statement and see what is inside blah
Cory R. King
2009-03-02 21:07:26