I have got the following function coming from an ajax call which is stored in a string variable.
obj.action="DisplayActivity('modalDisplay', 0, 4);"
I am trying to run it but without success. I tried with:
eval(obj.action);
and with:
window[obj.action]
Any ideas? Thanks.
evalto work,DisplayActivityshould be defined somewhere.DisplayActivityactually exist? You may be getting some errors in your console if it doesn't.evalworks, of course only if the function you are trying to call is in scope.window[obj.action]makes no sense.