0

Is it possible to fetch a Json string from a couch server using code such as

    $.couch.db(getDir).openDoc(getDoc, {
    success: function(data) {
        console.log(data);
        var myJson = data.toString();
        alert(myJson);
    },
    error: function(status) {
        console.log(status);
    }
});

Whenever I attempt to do this, myJson is always undefined

1 Answers1

0

Not sure if you're still looking for an answer on this.. What are 'getDir' and 'getDoc' set to? Assuming their values are getDir=(databasename) on getDoc=(a doc _id), this should work:

$.couch.db(getDir).openDoc(getDoc, {
success: function(data) {
    alert(JSON.stringify(data));
},
error: function(status) {
    alert("err:"+status);
}
});
Carol Skelly
  • 351,302
  • 90
  • 710
  • 624