figo2476 Posted July 26, 2008 Share Posted July 26, 2008 In php, it is able to do: $method_name = "save"; $object->$method_name; I wonder is there any way I can do a substitution like this in javascript. Quote Link to comment Share on other sites More sharing options...
corbin Posted July 26, 2008 Share Posted July 26, 2008 Hrmmm no idea if this will work or not, but it's worth a try: var func = "someFunc"; someclass.func(); Also, you could try it without the quotes, and I'm pretty sure that way would work for sure. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.