| Author |
javascript reflection ?
|
Edward Chen
Ranch Hand
Joined: Dec 23, 2003
Posts: 758
|
|
how to use javascript relection in an AJAX call ?
could I use some javascript reflection to invoke that method, like java reflection.. ?
Thanks.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56168
|
|
|
I assume firstName is a property. What method is there to invoke?
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56168
|
|
|
P.S. As a functional language, JavaScript has no methods -- though we frequently call functions that are properties of objects a "method" (even though they're really not).
|
 |
Edward Chen
Ranch Hand
Joined: Dec 23, 2003
Posts: 758
|
|
Bear Bibeault wrote:I assume firstName is a property. What method is there to invoke?
Yes, it is a property. Assume we need to write a tool to dynamically get an object property in the runtime. How could we do it in the JS ?
Thanks.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56168
|
|
Still not sure what you are asking. To access a property, you just reference it.
Or are you looking for a way to discover what properties an object has? If so, check out the for...in statement.
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26168
|
|
Edward,
Do you mean something like this:
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
stef li
Greenhorn
Joined: Jan 16, 2006
Posts: 27
|
|
i'm not clear about your question.
but i suggest you to research "js & class".
there may some useful articles for you.
|
This guy is so lazy!!!<br />There is nothing left!
|
 |
 |
|
|
subject: javascript reflection ?
|
|
|