Total newbie question. how do i get the following code to work.
var f_str = "function test(msg) { alert(msg) }"
var f = eval(f_str)
f("hello")
The idea is to have the function test as a string, and be able to execute it as a function. eval doesn't seem to work, and i have tried JSON.parse too, without luck..