Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 045BB912B for ; Thu, 10 May 2012 12:37:10 +0000 (UTC) Received: (qmail 23858 invoked by uid 500); 10 May 2012 12:37:08 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 23812 invoked by uid 500); 10 May 2012 12:37:08 -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 23804 invoked by uid 99); 10 May 2012 12:37:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 May 2012 12:37:08 +0000 X-ASF-Spam-Status: No, hits=4.6 required=5.0 tests=FREEMAIL_REPLY,FROM_LOCAL_NOVOWEL,HK_RANDOM_ENVFROM,HK_RANDOM_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of cgsmcmlxxv@gmail.com designates 209.85.216.45 as permitted sender) Received: from [209.85.216.45] (HELO mail-qa0-f45.google.com) (209.85.216.45) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 May 2012 12:37:00 +0000 Received: by qaeb19 with SMTP id b19so291243qae.11 for ; Thu, 10 May 2012 05:36:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=kf2CqIhqi+oxmgoZQbLUZCRQ82/NeVKUSe4L0LusjhM=; b=sknlpafdJQid1UyW5wiQvsfdWy8q+euZ6dx90hGKJ7jp4aO3Ms9NzLeLTHU4SHBHMW vbs+yd5Ul+/GVg7kkcxekL+qluo7yft/oUoiMiIdEzwIaR6uHMNyQAoyIBw5CNVwUN38 d5FzZZPTWBgnCJUdXUjplA7KPj29dr4I8LrYYDItxIDciFtdlHkWjFkyuJ5r0ENERbhd P9xChNkJiPFVj0y/Q+cyCDmwAVgddha9zNVxm2rCTZOtHQnEj1E/YxpmAz7CEZ0Zo0zA Sa3AKw1swABFqI8COiHStzup9rjk8WC31lEZNTjmfjhL244aA7Wkyx7RcAVp6sPRW9Dq fPog== MIME-Version: 1.0 Received: by 10.224.174.134 with SMTP id t6mr11281183qaz.83.1336653399724; Thu, 10 May 2012 05:36:39 -0700 (PDT) Received: by 10.229.74.80 with HTTP; Thu, 10 May 2012 05:36:39 -0700 (PDT) In-Reply-To: References: Date: Thu, 10 May 2012 14:36:39 +0200 Message-ID: Subject: Re: var $db = $.couch.db("mydatabase"); From: CGS To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=20cf303640b31411ba04bfaddf09 --20cf303640b31411ba04bfaddf09 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: quoted-printable Only if you set a security for that database. Otherwise, everyone can access that database, so, no login needed. CGS On Thu, May 10, 2012 at 2:29 PM, goog cheng wrote: > write doc into db via a couchapp , is a login necessary > > =D4=DA 2012=C4=EA5=D4=C210=C8=D5=D0=C7=C6=DA=CB=C4=A3=ACCGS =D0=B4=B5=C0= =A3=BA > > > Hi Goog, > > > > One thing for sure: $.couch.db function accepts and asks for two > parameters > > (line 263 from jquery.couch.js) while in your script you pass only one > and > > that can make your browser to discard db variable, so, it interprets it > as > > undefined. That if you use the same version of jquery.couch.js I use > > (coming by default with CouchDB 1.2). > > > > I hope this will help you in debugging your script. > > > > CGS > > > > > > > > > > On Thu, May 10, 2012 at 1:13 PM, goog cheng > > > wrote: > > > > > Hi, all! , i have a problem , please help and see it, THX! > > > > > > chrome sas: Uncaught TypeError: Cannot call method 'db' of undefined > > > > > > I HAVE INCLUDE : > > > > > > > > > db =3D $.couch.db("doc"); function uploaddoc() { $('

New > > > attachment

> > style=3D"border:0px;">
> > content-type=3D"multipart/form-data"> > > name=3D"_attachments"/>
File > > > description:
> > name=3D"att_descr_form">
> > id=3D"upfly">Upload > > > File
').appendTo('#uploadfly'); > > > $("#upfly").click(function() { //alert("saved!1"); //alert("saved!2")= ; > > doc > > > =3D new Object; doc.date =3D Date().toString().substring(3, 15); > > > doc._attachments =3D document.getElementById("_attachments"); > > db.saveDoc(doc, > > > { success: function() { alert("saved!"); }, }); }); } > > > > > > --20cf303640b31411ba04bfaddf09--