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 879CC9A60 for ; Thu, 10 May 2012 11:14:10 +0000 (UTC) Received: (qmail 91242 invoked by uid 500); 10 May 2012 11:14:09 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 91134 invoked by uid 500); 10 May 2012 11:14: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 91124 invoked by uid 99); 10 May 2012 11:14:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 May 2012 11:14:08 +0000 X-ASF-Spam-Status: No, hits=1.8 required=5.0 tests=HTML_FONT_FACE_BAD,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of googcheng@gmail.com designates 209.85.213.180 as permitted sender) Received: from [209.85.213.180] (HELO mail-yx0-f180.google.com) (209.85.213.180) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 May 2012 11:14:01 +0000 Received: by yenq6 with SMTP id q6so1636254yen.11 for ; Thu, 10 May 2012 04:13:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=qcD1QiocYQuXyKjNJxtXKNAXoG9O24HTev99ZShEIog=; b=XY2i9KmSjrmf0OAPP2ZUmfchCrByN19T1HBq34Ux0LQDMb1IGUYQcy7qBM0QFrSPBM FyT+wFNZV0H0UkmxalQj8GeJBpg88WNX2iRhEHEiRhHQ8G4Idk0knH0XUzEYZUT03c2q l/q0RTxG7nj177svxRcm+sT+L307zDzjTF9UysVVZOaOG6pjfHfexu2w1138BUm1Osb5 cpguqOUlf6alHK73lsOjkkfT++dFddhVyDxfMDpZrrnBAsW5UGilBQ6qm26IeseRTjsI KfuEcFE0XWBFjD/YHOKL/Yz/5pjTqFZX+urTfBeREww/K+b3qgx9qHYsovaCJuWD/HV1 EiXQ== MIME-Version: 1.0 Received: by 10.236.175.105 with SMTP id y69mr4563388yhl.83.1336648421260; Thu, 10 May 2012 04:13:41 -0700 (PDT) Received: by 10.101.55.17 with HTTP; Thu, 10 May 2012 04:13:41 -0700 (PDT) Date: Thu, 10 May 2012 19:13:41 +0800 Message-ID: Subject: var $db = $.couch.db("mydatabase"); From: goog cheng To: user@couchdb.apache.org Content-Type: multipart/mixed; boundary=20cf305b0cba56bc8904bfacb686 X-Virus-Checked: Checked by ClamAV on apache.org --20cf305b0cba56bc8904bfacb686 Content-Type: multipart/alternative; boundary=20cf305b0cba56bc8404bfacb684 --20cf305b0cba56bc8404bfacb684 Content-Type: text/plain; charset=ISO-8859-1 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 = $.couch.db("doc"); function uploaddoc() { $('

New attachment

File description:

').appendTo('#uploadfly'); $("#upfly").click(function() { //alert("saved!1"); //alert("saved!2"); doc = new Object; doc.date = Date().toString().substring(3, 15); doc._attachments = document.getElementById("_attachments"); db.saveDoc(doc, { success: function() { alert("saved!"); }, }); }); } --20cf305b0cba56bc8404bfacb684 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, =A0all! , i =A0have a problem =A0, please help and see it, =A0THX!
=
chrome sas: Uncaught TypeError: Cannot call method '= db' of undefined

I HAVE INCLUDE :
<= ;script src=3D"scripts/upload.js"></script> <script src=3D"/_utils/script/jquery.couch.js"></script&= gt;

= db =3D $.couch.db("doc"); function uploaddoc() { $('<h3>New attachment</h3><table style=3D"border:0= px;"><tr valign=3D"top"><td style=3D"border= :0px;"><form id=3D"attachment-form" name=3D"attac= hment_form" content-type=3D"multipart/form-data"><inpu= t id=3D"_attachments" type=3D"file" name=3D"_attac= hments"/></form></td><td style=3D"border:0px;&q= uot;>File description:</td><td style=3D"border:0px;"&= gt;<form id=3D"att-descr-form" name=3D"att_descr_form&quo= t;><textarea name=3D"attachdescr" style=3D"height:50px= ; width:450px;" ></textarea></form></td><td st= yle=3D"border:0px;"><button id=3D"upfly">Uploa= d File</button><br/></td></tr></table>').= appendTo('#uploadfly'); =09 =09 $("#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() {=20 alert("saved!"); }, }); =20 }); =09 } =09
--20cf305b0cba56bc8404bfacb684-- --20cf305b0cba56bc8904bfacb686--