Re: [json] Re: [question] parse json with ajax
- On 15/08/07, Michal Migurski <mike-jsonphp@...> wrote:
>Ugh, don't do that. Apart from screwing with the scope of
> This should help:
> eval("var responsejson = (" + responsetext + ");");
responsejson, it also causes a security problem, and it's overkill.
If you must use eval, do it this way:
var responsejson = eval( "(" + o.responseText + ")" );
That won't take away the security problems with eval, but it will make
sure that responsejson is in current scope.