Caritatis

Just another WordPress.com weblog

JavaScript Object “Inspector” July 19, 2011

Filed under: JavaScript — caritatis @ 7:42 pm

I found this today on a site, and it’s easy to use when using someone else’s object that you just don’t have the info for:

<SCRIPT>
ret = prompt (“Enter object”, “document”);
obj = eval(ret);
var temp = “”;
for (x in obj)
temp += x + “: ” + obj[x] + “\n”;
alert (temp);
</SCRIPT>

OR:

obj = match;
var temp = ”;
for (x in obj)
temp += x + ‘: ‘ + obj[x] + ‘\n’;
alert (temp);

Found on : http://javascript.internet.com/debug-guide.html. The page is OLD (Netscape 2?, Win 3.1?), but it still has some handy tips, like this :)

Advertisement
 

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.