incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nitin Borwankar <ni...@borwankar.com>
Subject Re: callback=? parameter expected by jQuery $.ajax() causes couch to complain about bad URL
Date Sun, 02 Aug 2009 07:31:59 GMT
Oliver Boermans wrote:
> 2009/8/2 Nitin Borwankar <nitin@borwankar.com>:
>   
>> but when the type is "json" and I try alert(data.version) or
>> alert(data['version'])  I get "undefined".
>>
>> $.get("http://localhost:5984/", function(data){ alert(data.version); },
>> "json" );
>> $.get("http://localhost:5984/", function(data){ alert(data['version']); },
>> "json" );
>>     
>
> Have you tried getJSON?:
> http://docs.jquery.com/Ajax/jQuery.getJSON
>
> Failing that you ought to be able to construct the request you need
> using the more generic jQuery ajax method:
> http://docs.jquery.com/Ajax/jQuery.ajax#options
>
> Sorry I can’t try jsonp here - my couch is broken :/
>   
Hi Oliver,

yes I started with that - it's a long story but it comes down to couch 
returning content-type text plain in the HTTP response headers,
so an extra JSON.parse() has to be applied to get json.

See my other email.

Many thanks to Paul for his patience.  And good luck with your upgrade.
Have you tried CouchDBX - after many travails with 0.8.1 building from 
source on the Mac - I just switched to CouchDBX and have been very happy 
with it.  I do build 0.9.0 from source on Ubuntu.

Nitin


Mime
View raw message