jQuery and CouchDBX - _all_docs - HTTP 200 but no data is returned to success function
I can't access my CouchDB server (CouchDBX) using a jQuery AJAX call.
I am able to access my demo database at localhost:5984/helloworld/_all_docs
through browsers (tested with FireFox, Chrome and Safari). But when I do a simple AJAX call using jQuery I get no data returned.
The requests completes with code 200.
Here's what my AJAX call looks like:$(function ()
{
$.ajax(
{
cache: false,
dataType: "json",
error: function (xmlHttpRequest, textStatus, errorThrown)
{
cons开发者_如何学Goole.log("error", xmlHttpRequest, textStatus, errorThrown);
},
global: false,
success: function (data, textStatus, xmlHttpRequest)
{
console.log("success", data, textStatus, xmlHttpRequest);
},
timeout: 3000,
url: "http://localhost:5984/helloworld/_all_docs"
});
});
What am I doing wrong?
UpdateScreenshots of FireBug console:
http://grab.by/6fkS
http://grab.by/6fkX
http://grab.by/6fkY
I think your browser is blocking the data.
XmlHttpRequest error: Origin null is not allowed by Access-Control-Allow-Origin
http://www.w3.org/TR/cors/
精彩评论