aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Reflection for js? 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 "Reflection for js?" Watch "Reflection for js?" New topic
Author

Reflection for js?

graham king
Ranch Hand

Joined: Dec 30, 2004
Posts: 133
Is there a way to pass in the name of a method and have javascript execute it?

Something like reflection.

Thanks.


write, revise, re-write, revise, again...<br />write, revise, re-write, revise, again...
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41809
    
  62
There is the "eval (string)" method, which evaluates its argument as if it were JavaScript code.
[ May 24, 2006: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61191
    
  66

Consider the following:



[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
graham king
Ranch Hand

Joined: Dec 30, 2004
Posts: 133
Thanks Ulf,

Worked like a charm!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reflection for js?