This is not the safest thing in the world, but you can do it:
var value = null, txt = this.responseText;
eval("value = (" + txt + ")");
This might be a little safer:
var value = null, txt = this.responseText;
!function(window) { eval("value = (" + txt + ")"); }();
but there are still all kinds of potential hacks. You better use a library.
source
share