couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Boermans <boerm...@gmail.com>
Subject Re: callback=? parameter expected by jQuery $.ajax() causes couch to complain about bad URL
Date Sun, 02 Aug 2009 07:20:12 GMT
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 :/

Mime
View raw message