I have an object I need to examine in IE8.
I tried the developer tools and console.log
, their Firebug equivalent.
However, when I output the object to the log:
console.log("Element: ", element);
console.log(element);
I only get the string
LOG: Element: [object Object]
instead of a clickable, examinable dump.
Is it possible to dump an object to the Log and examine its members, like in Firebug?
I can't use a homemade dump() function because the element I want to examine is so huge the browser will crash on me.
If you're dealing with nasty code and console.log is not available, try this in the console:
@Chris commented @Andy's answer with the simple solution: Use
console.dir(myObj)
to get all the details printed out in the console in IE. Thanks Chris!Add this Tag in your page :
And the things will work.
Its working on my system.
Note: Do try this solution.
A pictorial version of Xavi's excellent answer:
Here's one technique that I've found helpful:
console.log(element.toString()) might be your friend here...