ldsmike88 Posted March 17, 2007 Share Posted March 17, 2007 I have a variable that contains some functions I want executed. For example: var mystring = "myFunction('hello');mySecondFunction('me', 'again');"; I tried using eval(mystring) but that didn't work. How would I go about executing those functions? Thanks! Quote Link to comment Share on other sites More sharing options...
emehrkay Posted March 17, 2007 Share Posted March 17, 2007 eval should work x = 'alert("dasfdf");'; eval(x); would alert Quote Link to comment Share on other sites More sharing options...
ldsmike88 Posted March 17, 2007 Author Share Posted March 17, 2007 But it doesn't work. I get an "Object Expected" error. This is what I have: executeFunctions("update('EFY', 'Jul 09 2007 11:00:00');"); function executeFunctions(functions){ eval(functions); } Quote Link to comment Share on other sites More sharing options...
ldsmike88 Posted March 18, 2007 Author Share Posted March 18, 2007 Answered in the AJAX forum: http://www.phpfreaks.com/forums/index.php?topic=131773.new;topicseen#new 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.