you're evaluating this string "(req.responseText)". If I'm not mistaken eval happens on the global scope, so I assume the 'req' variable is not available globally.
Anyway, why are you using eval? jQuery handles JSON responses by itself. - ricardo On Nov 28, 11:31 pm, aarti <[EMAIL PROTECTED]> wrote: > Hi, > > I am getting error while trying to print the content of json string. > My servlet is getting evaluated as it is alerting the next statement > immediately after eval line in the code. > > >0] alert(req.responseText); > >1] doc_json = eval('('+ req.responseText+')'); > >2] alert("eval successful"); > >3] alert(doc_json.feed.channels[0].name); > > It gives me alert upto 2] line as "eval successful". Immediately after > that I am getting error as "doc_json undefined". > I tested my json string, it is fine too. > Can anybody please tell me what could be the problem? > > Thanks.