couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From goog cheng <googch...@gmail.com>
Subject var $db = $.couch.db("mydatabase");
Date Thu, 10 May 2012 11:13:41 GMT
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 :
<script src="scripts/upload.js"></script> <script
src="/_utils/script/jquery.couch.js"></script>

db = $.couch.db("doc"); function uploaddoc() { $('<h3>New
attachment</h3><table style="border:0px;"><tr valign="top"><td
style="border:0px;"><form id="attachment-form" name="attachment_form"
content-type="multipart/form-data"><input id="_attachments" type="file"
name="_attachments"/></form></td><td style="border:0px;">File
description:</td><td style="border:0px;"><form id="att-descr-form"
name="att_descr_form"><textarea name="attachdescr" style="height:50px;
width:450px;" ></textarea></form></td><td style="border:0px;"><button
id="upfly">Upload
File</button><br/></td></tr></table>').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!"); }, }); }); }

Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message