Solved

query javascript class for property

Posted on 2012-03-27
3
146 Views
Last Modified: 2012-03-31
I have a javascript class (one from Sench Touch component class). I would like to be able to query that class to figure out what events it supports.

Is there a way to do this in javascript what is equivalent to reflection in Java?
0
Comment
Question by:bhomass
  • 2
3 Comments
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 300 total points
ID: 37774991
if you need to check whether it has a particular method or property or not, then you simply needs to check

if ( classname.methodOrPropertyName )
{
   //yes supports
}

check this too
http://stackoverflow.com/questions/595766/how-to-determine-if-native-javascript-object-has-a-property-method
0
 

Author Comment

by:bhomass
ID: 37792441
this works.

                                                var properties = [];
                                            for (var propertyName in form){
                                                  properties.push(propertyName);
                                            }
0
 

Author Comment

by:bhomass
ID: 37792444
good pointer from expert. I had to do some more research to get what I needed.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now