From user-return-5754-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Sun Aug 02 07:32:28 2009 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 84065 invoked from network); 2 Aug 2009 07:32:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Aug 2009 07:32:28 -0000 Received: (qmail 51301 invoked by uid 500); 2 Aug 2009 07:32:31 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 51209 invoked by uid 500); 2 Aug 2009 07:32:30 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 51199 invoked by uid 99); 2 Aug 2009 07:32:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Aug 2009 07:32:30 +0000 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [66.111.4.25] (HELO out1.smtp.messagingengine.com) (66.111.4.25) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Aug 2009 07:32:20 +0000 Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id 629743BD969; Sun, 2 Aug 2009 03:32:00 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Sun, 02 Aug 2009 03:32:00 -0400 X-Sasl-enc: smN1DvkwQv5DridtEU+rW5Op4styxjZjWUdYYVC/T+Fe 1249198321 Received: from NitinBorwankarsComputer.local (c-71-202-180-50.hsd1.ca.comcast.net [71.202.180.50]) by mail.messagingengine.com (Postfix) with ESMTPA id 412F01BE3 for ; Sun, 2 Aug 2009 03:32:01 -0400 (EDT) Message-ID: <4A7540EF.3070003@borwankar.com> Date: Sun, 02 Aug 2009 00:31:59 -0700 From: Nitin Borwankar User-Agent: Thunderbird 2.0.0.22 (Macintosh/20090605) MIME-Version: 1.0 To: user@couchdb.apache.org Subject: Re: callback=? parameter expected by jQuery $.ajax() causes couch to complain about bad URL References: <921000908011857s26dbfcc8y7dc79b353f2efd98@mail.gmail.com> <4A74FD6C.7030907@borwankar.com> <4A750B42.3000003@borwankar.com> <4A7517C9.8040300@borwankar.com> <4A752BBC.4050403@borwankar.com> <4A75377E.90108@borwankar.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Oliver Boermans wrote: > 2009/8/2 Nitin Borwankar : > >> 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