How do I perform an Ajax request to CouchDB (http://.couchone.com/)

前端 未结 2 1792
借酒劲吻你
借酒劲吻你 2021-02-10 20:37

I\'m trying to create a simple AJAX (via jQuery) request to http://yourusername.couchone.com/ (alsmost the same as if I had installed couchdb on localhost)

2条回答
  •  醉酒成梦
    2021-02-10 21:19

    I'd say that MightyE's totally right, up to the postscript -- CouchOne does support JSONP. Go to http://YOURSITE.couchone.com/_utils/config.html and change allow_jsonp in the httpd section to true. After that,

    $.ajax({
       url: 'http://yoursite.couchone.com/',
       type: 'get',
       dataType: 'jsonp',
       success: function(data) {
          alert(data.couchdb);
          alert(data.version);
       }
    });
    

    will work.

提交回复
热议问题