incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Nolen <dnolen.li...@gmail.com>
Subject Re: JSONP callback param with couchdb -lucene
Date Sun, 09 Aug 2009 17:24:33 GMT
The callback
function must be available in the global scope for JSONP to work correctly.
David

On Sun, Aug 9, 2009 at 12:15 AM, Nitin Borwankar <nitin@borwankar.com>wrote:

>
> Hi all,
>
> Need some help with the cdb-luc and jQuery integration.
>
> I want to transform the results format from cdb-luc to a format that my app
> likes. I want to do that via the JSONP callback param and some jquery
> hoop-jumping.   Am curious if the syntax is as follows or something else:-
>
> .....?q=somequerytext&callback=somefuncname
>
>
> then inside $.ajax() I would have
>
> {
>  url:  <my cdb luc url>?q=somequerytext&callback=somefuncname
>  [....]
>  dataType: "json",
>  contentType: "application/json"
>  [...]
>  success:     somefuncname(data) { get data and transform it into something
> recognizable to my app, do something with it } ;
>  error:         complain(){....}
>
> }
>
>
> etc. and then the cdb-luc results will be magically stuffed into somefunc()
> as data
>
> Is this the right syntax for the ?q = part for all that to happen -
> basically just macth the name in the callback param with the actual name in
> the success: param in $.ajax() ?
>
> Has anyone used the callback param sucessfully ?
>
>
> Nitin Borwankar
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message