Jump to content

Does an Oject dump exist in JavaScript.


atrum

Recommended Posts

Hello again,

 

Just a quick and hopefully simple question in regards to Objects.

 

Is there a way to get an object to show all of its properties and methods?

 

For an example lets use the form object.

How do I get the form object to show all of it's properties and methods?

Link to comment
Share on other sites

If you use Firebug, you can view a tree-menu style list of an object, plus it's children and parents, by adding a 'watch expression'.

 

Assuming you have it installed, open it on the page you wish to debug and select the 'Script' tab. In the left panel you'll see the JavaScript for that page, and within in the left margin of that panel, on the line containing a reference to the object, click in the left margin and a red dot should be appear. Run the code again, either by refreshing or calling the event that triggers the code, and in the right panel you should see the object.

 

It's not the most straight-forward tool to use, but it means you don't have to add debug functions or output to find the problem.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.