Fellow Stranger Fellow Stranger - 1 year ago 75
Javascript Question

I want to display an object's values in chrome's console

It's something I'm missing in Chrome's console. I'm following a screencast where a javascript object is displayed in a browsable tre-like structure like this:

(arrow here) Object

When typing this for example, I'm only getting an empty array:


Answer Source

If you want to browse the elements within the jQuery object, you'll have to select something first.
$() returns an empty jQuery object.

If, on the other hand, you want to browse the methods/properties of the object created, you should use the console.dir method, which will give you a more in-depth view of your object:


Here's the fiddle: http://jsfiddle.net/asYay/

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download