couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Cottlehuber <>
Subject Re: how to save json document into couchdb using javascript
Date Mon, 03 Sep 2012 12:23:59 GMT
On 3 September 2012 06:48, lenin <> wrote:
> yes...same ip for both.........
> --
> View this message in context:
> Sent from the CouchDB Development mailing list archive at

Hi Lenin,

Let's shift this conversation to the user@ mailing list where it's
more appropriate.

You'll need to share some of your non-working code with us, to better
understand where you are stuck --  e.g. on or

The issue you are having is that the call you're trying to make is
forbidden because they're different origins. I suggest you google for
an explanation in your native language, it will help a lot.

There are many ways of working around this, but the simplest way in
CouchDB is simply to serve the HTML & the database from the same
origin. This is way cool. There is a tool called couchapp which
synchronises files on disk with design documents in your database and
makes this really really simple.


- download & install couchapp for your platform[1]
- then `couchapp generate myapp`
- put your html files (like index.html and js files) in "myapp/_attachments/"
- `couchapp push` will send these new files to your localhost:5984 (in
admin party) into a new db called myapp
- visit the new url and play

You can use the same code that futon does jquery.couch.js[2] and check
in the test suite for examples on how to hook all of that together.
Running the test suite in the chrome developer tools gives a very good
overview of how this stuff should work.

Useful docs for jquery.couch.js[2] and test suite[3] follow.



View raw message