I'm trying to connect to my CouchDB on Cloudant using jQuery
and jQuery.couch.sj
However, I can't even get the most basic info about my database. For example the following code prints nothing to the console.
Code
<script>
$.couch.urlPrefix ="https://acharya.cloudant.com";
$.couch.info({
success: function(data) {
console.log(data);
}
});
</script>
I've looked at the online documentation but to no avail.
If I type
var db= $.couch.db("toxtweet");
console.debug(db);
to see something about one of my CouchDB's, I get:
Object { name="toxtweet",uri="https://acharya.cloudant.com/toxtweet/", compact=function(),
more...}
And that is the correct URI. So, how would I, for example, get the number of documents in the "toxtweet" database? Trying the example doesn't work.
Update If I view the page in Chrome instead of Firefox I see the following error.
XMLHttpRequest cannot load https://acharya.cloudant.com/. Origin http://tox.sinaiem.org is not
allowed by Access-Control-Allow-Origin.
I thought that Cloudant was a CouchApp that bypassed the same-origin policy.