WE mainly use eval() method while working with AJAX response which sometime contains some executable java script code to run.
Even many of the Java script lib/framework uses this heavily in their AJAX frameworks.
1. eval(statement) //statement can be any java script method.
2. eval(string) //any raw string containing the java script expressions. e.g eval(“alert(‘hello’)”);
[NOTE] This method is widely supported by most of the known browsers like IE, Mozilla, OPera, Safari, Chrome.
Hope this helps.