For example, if I have a string variable that stores ', how can I run it or convert it to source code?
For example, if I have a string variable that stores ', how can I run it or convert it to source code?
You can use eval () that evaluates (and executes) the code represented in a string. Example:
var comm = "alert('teste');";
eval(comm); //Executa o alert