On Aug 24, 2010, at 2:35 AM, Nils Breunese wrote:

> Dan wrote:
> 
>> If I wanted to get a view I could do this
>> 
>> localhost:5984/mydatabase/_view/myview
>> and that would return some json
>> 
>> What would I do if I wanted it to return jsonp?
>> or if that question doesn't make sense.
>> How do I return a view as jsonp?
> 
> Add the callback parameter to the URL and specify a name for the JSONP 
> callback function:
> 
> http://example.com:5984/mydatabase/_design/myddoc/_view/myview?callback=foo
> 
> If you use jQuery, you can let jQuery generate a callback function name by 
> using a question mark as the callback function name.
> 

You also  need to activate JSONP in the configuration. It's off by default 
because it is insecure.

> Nils.
> 
> P.S. It seems neither the wiki nor the Definitive Guide mention JSONP?
> 
> De informatie vervat in deze  e-mail en meegezonden bijlagen is uitsluitend 
> bedoeld voor gebruik door de geadresseerde en kan vertrouwelijke informatie 
> bevatten. Openbaarmaking, vermenigvuldiging, verspreiding en/of verstrekking 
> van deze informatie aan derden is voorbehouden aan geadresseerde. De VPRO 
> staat niet in voor de juiste en volledige overbrenging van de inhoud van een 
> verzonden e-mail, noch voor tijdige ontvangst daarvan.

Reply via email to