2

Is there any way i can explore the properties and /or functions of a java script object(Like a telerik menu or anyother 3rd party object)? the way i can by debugging and breaking and then adding an object in the watch or by using intellisense in VS.

I use vs2008 and i do have the basic intellisense for javascript.

I think i will be able to get a lot more done if i could do it.

2 Answers 2

5

A personal favorite of mine is to do it directly in browser, using Firefox and the Firebug extension/plugin.

You can set breakpoints, and explore the javascript object itself, as well as DOM elements, from the plugin window. You also get a handy console/interpreter for exploring or executing arbitrary JS (such as to manually trigger a method, or an AJAX call).

Sign up to request clarification or add additional context in comments.

2 Comments

The Web Inspector in Safari and Chrome works similarly. Very handy.
I actually do use firebug but had never used it for js debugging. Thanks.
5

I'm not sure if this is what you have in mind, but you can iterate through the members of an object like so:

var myObj = {a: 42, b:"blah", c: function(){alert("hello world");}};

for(var member in myObj){
  console.log("Name: " + member);
  console.log("Value: " + myObj[member]);
}

1 Comment

As others have said, there are also useful tools for exploring JS objects in many web browsers, but something like the above could be useful to you if you want to determine what properties an object has at runtime.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.