incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "john.tiger" <john.tigernas...@gmail.com>
Subject Re: need help with jquery.couch
Date Sat, 15 Sep 2012 22:23:56 GMT


On 09/15/2012 03:56 PM, Ryan Ramage wrote:
> John, just guessing but are you trying to access your couchdb from a
> local html file? ie opening file://somepath/index.html and trying to
> access couchdb? If so, you cant do that because of cross domain
> requests. You would want to move to a couchapp type tool if you want
> to do simple html pages, access couchdb.

what I mean by simple html app was that it was not a couchapp

actually using nginx set up with a local fake domain on each development 
machine - so I do not think that is a problem

had originally tried with a success call which was not called (but with 
that info, will experiment more in that direction.
>
> If you want to see the jquery.couch.js api, look here:
> http://daleharvey.github.com/jquery.couch.js-docs/symbols/%24.couch.db.html
>
> Also, there are a million ways to do this, but I would humbly
> recommend https://github.com/garden20/baseline-garden-app . It is
> pretty easy to get going with. Ping  me, or join #kanso if you need
> help.
>
> Other options include putting a proxy in-front of your couchdb that
> will allow you to access it cross domain.
>
> Ryan
>
> On Sat, Sep 15, 2012 at 3:43 PM, Zera Holladay<zeraholladay@gmail.com>  wrote:
>> The calls are all async.  Add success callbacks like jQuery examples.
>> On Sep 15, 2012 5:27 PM, "john.tiger"<john.tigernassau@gmail.com>  wrote:
>>
>>> using couch 1.2 (debian unstable) in a simple html 5 page
>>> I pulled jquery.couch.js from github  - is this right version to use ?
>>>   trying to follow various references resulted in no data being shown.
>>>   chrome js console not showing errors
>>>
>>> working:
>>> var test = $.couch.db("mydb");
>>> alert("test"+ JSON.stringify(test));
>>> =>  alert shows name of database
>>>
>>> not working:
>>> var db = "mydb";
>>> var test = $.couch.db(db);
>>> alert("test"+ JSON.stringify(test));
>>>
>>> not working:
>>> var test = $.couch.allDocs();
>>> alert("test"+ JSON.stringify(test));
>>> (also did not work for allDbs, info, )
>>>
>>> not working:
>>> $db = $.couch.db("mydb");
>>> var test = $db.allDocs();
>>> alert("test"+ JSON.stringify(test));
>>>
>>> not working:
>>> $.couch.urlPrefix = "http://127.0.0.1:5984";
>>> var test = $.couch.allDbs();
>>> alert("test"+ JSON.stringify(test))
>>>
>>>
>>>


Mime
View raw message