You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by "Hay (Husky)" <hu...@gmail.com> on 2010/02/16 00:28:47 UTC

jQuery plugins for CouchDB

Hi everyone,
for a website we're currently building i'm experimenting with jQuery
to get CouchDB results from a server. I've been looking into jQuery
plugins to make everything a little easier, but after doing some
research i haven't come up with much, so i hope maybe someone on this
list could get me a little further.

One plugin i've found is called jqCouch, but the last release is from
2007, so i guess that's pretty ancient in CouchDB terms. I guess JSONP
support (which is essential for the site i'm building) is not in
there.

The other plugin is the 'official' one shipped with the tarball for
the view frontend (jquery.couch.js). I get the feeling that the plugin
is only written for the view backend, because it doesn't have any
documentation and it also seems to lack JSONP support and setting
another server than 'localhost'. Of course, i could hack the
jquery.couch.js plugin to add support for both, but i'm hoping that
there's another, easier solution.

Thanks,
-- Hay

Re: jQuery plugins for CouchDB

Posted by Ladislav Thon <la...@gmail.com>.
It is actually very easy to modify jquery.couch.js to support other hosts --
I did it some time ago when experimenting and it was only few lines of code.
And if I remember correctly, such modification is already in trunk (it adds
uriPrefix variable).

I also believe JSONP was kinda working, but I'm not quite sure about that
now -- I switched to using server-side proxy for handling "cross site"
requests.

LT

2010/2/16 J Chris Anderson <jc...@gmail.com>

>
> On Feb 15, 2010, at 3:28 PM, Hay (Husky) wrote:
>
> > Hi everyone,
> > for a website we're currently building i'm experimenting with jQuery
> > to get CouchDB results from a server. I've been looking into jQuery
> > plugins to make everything a little easier, but after doing some
> > research i haven't come up with much, so i hope maybe someone on this
> > list could get me a little further.
> >
> > One plugin i've found is called jqCouch, but the last release is from
> > 2007, so i guess that's pretty ancient in CouchDB terms. I guess JSONP
> > support (which is essential for the site i'm building) is not in
> > there.
> >
> > The other plugin is the 'official' one shipped with the tarball for
> > the view frontend (jquery.couch.js). I get the feeling that the plugin
> > is only written for the view backend, because it doesn't have any
> > documentation and it also seems to lack JSONP support and setting
> > another server than 'localhost'. Of course, i could hack the
> > jquery.couch.js plugin to add support for both, but i'm hoping that
> > there's another, easier solution.
>
> The official jquery.couch.js is actively maintained and plugs into a lot of
> existing code. I highly recommend you use it if at all possible. Patches for
> JSONP would be welcome if you can do it in a clean way.
>
> You will probably be happier hosting your HTML as attachments to CouchDB
> documents, and then using the jquery.couch.js code from there -- then you
> don't have to worry about cross site requests.
>
> Chris
>
>
>
> >
> > Thanks,
> > -- Hay
>
>

Re: jQuery plugins for CouchDB

Posted by J Chris Anderson <jc...@gmail.com>.
On Feb 15, 2010, at 3:28 PM, Hay (Husky) wrote:

> Hi everyone,
> for a website we're currently building i'm experimenting with jQuery
> to get CouchDB results from a server. I've been looking into jQuery
> plugins to make everything a little easier, but after doing some
> research i haven't come up with much, so i hope maybe someone on this
> list could get me a little further.
> 
> One plugin i've found is called jqCouch, but the last release is from
> 2007, so i guess that's pretty ancient in CouchDB terms. I guess JSONP
> support (which is essential for the site i'm building) is not in
> there.
> 
> The other plugin is the 'official' one shipped with the tarball for
> the view frontend (jquery.couch.js). I get the feeling that the plugin
> is only written for the view backend, because it doesn't have any
> documentation and it also seems to lack JSONP support and setting
> another server than 'localhost'. Of course, i could hack the
> jquery.couch.js plugin to add support for both, but i'm hoping that
> there's another, easier solution.

The official jquery.couch.js is actively maintained and plugs into a lot of existing code. I highly recommend you use it if at all possible. Patches for JSONP would be welcome if you can do it in a clean way.

You will probably be happier hosting your HTML as attachments to CouchDB documents, and then using the jquery.couch.js code from there -- then you don't have to worry about cross site requests.

Chris



> 
> Thanks,
> -- Hay