couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From francisco treacy <>
Subject jquery and trailing \n
Date Thu, 18 Jun 2009 12:06:54 GMT
Hi all,

I'm trying to get something super simple running in Firefox, not
without problems.

>From a local html file I am using jQuery to make an ajax call to
CouchDB like so:
function(data) { alert(data._id); })
but Firebug always shows an "invalid label" error, with the following
response: {"_id":"test","_rev":"1-1480939370"}\n

For instance, this works ok:
function(data) { alert(data.title); })

Also when I try with a local json file (just {title: "test"}) it works
fine, when i put {title: "test"}\n , it doesn't.

Could the trailing \n be the problem here? Any other pointers from
people who have tried parsing CouchDB's json with jQuery?

Thanks in advance,


View raw message