I was wondering how to run JS code posted by a user in the TextArea when he presses button without refreshing the entire page. I want to have a canvas, a TextArea and a button. When the button is pressed, it runs code from the TextArea and then paints stuff on the canvas.
I know how to put the posted code into variable string.
What I don't know is how to run code in that string.