• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reflection for js?

 
graham king
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to pass in the name of a method and have javascript execute it?

Something like reflection.

Thanks.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is the "eval (string)" method, which evaluates its argument as if it were JavaScript code.
[ May 24, 2006: Message edited by: Ulf Dittmer ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider the following:

 
graham king
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf,

Worked like a charm!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!