0
For example, if I have a string variable that stores "Alert('test');", how I can run it or convert it to source code?
0
For example, if I have a string variable that stores "Alert('test');", how I can run it or convert it to source code?
3
You can use the val() that evaluates(and executes) the code represented in a string. Example:
var comm = "alert('teste');";
eval(comm); //Executa o alert
Browser other questions tagged javascript
You are not signed in. Login or sign up in order to post.