aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes javascript reflection ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "javascript reflection ?" Watch "javascript reflection ?" New topic
Author

javascript reflection ?

Edward Chen
Ranch Hand

Joined: Dec 23, 2003
Posts: 798
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: 61653
    
  67

I assume firstName is a property. What method is there to invoke?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61653
    
  67

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: 798
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: 61653
    
  67

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
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30937
    
158

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!
 
Consider Paul's rocket mass heater.
 
subject: javascript reflection ?