couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Woodward <m...@mattwoodward.com>
Subject Line Breaks in JSON Causing Issue With jQuery
Date Tue, 09 Nov 2010 17:49:20 GMT
Hello fellow relaxers--I'm fairly new to CouchDB and loving it so far, but I
ran into a bit of an issue when calling a view directly from jQuery. I'm
sure I'm just missing something obvious, but here goes.

I have a view in CouchDB that I'm calling from jQuery like so:

var couchURL = "
http://server:5984/database/_design/mydesigndoc/_view/viewName";
$.ajax({
    dataType: "jsonp",
    url: couchURL,
    jsonpCallback: "myCallback",
    success: myCallback
});

The view works fine when I hit it in a browser. The problem I'm having is
that, I believe because of the line break after the first array bracket in
the "rows" element, jQuery doesn't see this as valid JSON. The error I get
is "invalid label" and it appears to break right at the line break (at least
according to Firebug).

Any suggestions welcome. Thanks!

-- 
Matthew Woodward
matt@mattwoodward.com
http://blog.mattwoodward.com
identi.ca / Twitter: @mpwoodward

Please do not send me proprietary file formats such as Word, PowerPoint,
etc. as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message