Robert James schrieb:


On 7/19/07, *Klaus Hartl* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:


    Robert James wrote:
    >
    >
    > Is there a way to list all the methods that a particular JavaScript
    > object has? Or is there a tool that can do this?

    Speaking of tools, I highly recommend the Firebug extension for
    Firefox,
    truly essential for web development.

    You could easily log your object into the console, like

    console.log(obj);

I indeed do use Firebug. I see how it can inspect properties; but how do I use it to show methods?
Hi Robert,

simply type in the name of the object in the console and hit Enter (or CTRL-Enter):

var mySuperObj = {
 'superInt' : 42,
 'superFunc' : function() {
   alert('superfunc!');
 },
 'superObj': {
   'otherFunc' : function() {
     alert('otherfunc');
   }
 }
};

Firebug Console:
mySuperObj [ENTER]

now you can navigate through the object, including the functions...

--- Marc

Reply via email to