summaryrefslogtreecommitdiff
path: root/share/www
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2008-05-25 14:15:53 +0000
committerChristopher Lenz <cmlenz@apache.org>2008-05-25 14:15:53 +0000
commit7ac8071d93b07dd50afe72395052e285f6cc3509 (patch)
treee73f28dfffbd168e85870048467babef0d7ce623 /share/www
parent915128d088179b90508a5ce553d144e1ece227fe (diff)
Improve jQuuery-based CouchDB interface so that it doesn't report an error when no 'success' callback was provided.
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@659989 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www')
-rw-r--r--share/www/script/jquery.couch.js52
1 files changed, 26 insertions, 26 deletions
diff --git a/share/www/script/jquery.couch.js b/share/www/script/jquery.couch.js
index 71a3c787..11ae4340 100644
--- a/share/www/script/jquery.couch.js
+++ b/share/www/script/jquery.couch.js
@@ -20,8 +20,8 @@
type: "GET", url: "/_all_dbs",
complete: function(req) {
var resp = $.httpData(req, "json");
- if (req.status == 200 && options.success) {
- options.success(resp);
+ if (req.status == 200) {
+ if (options.success) options.success(resp);
} else if (options.error) {
options.error(req.status, resp.error, resp.reason);
} else {
@@ -43,8 +43,8 @@
type: "POST", url: this.uri + "_compact", dataType: "json",
complete: function(req) {
var resp = $.httpData(req, "json");
- if (req.status == 202 && options.success) {
- options.success(resp);
+ if (req.status == 202) {
+ if (options.success) options.success(resp);
} else if (options.error) {
options.error(req.status, resp.error, resp.reason);
} else {
@@ -59,8 +59,8 @@
type: "PUT", url: this.uri, dataType: "json",
complete: function(req) {
var resp = $.httpData(req, "json");
- if (req.status == 201 && options.success) {
- options.success(resp);
+ if (req.status == 201) {
+ if (options.success) options.success(resp);
} else if (options.error) {
options.error(req.status, resp.error, resp.reason);
} else {
@@ -75,8 +75,8 @@
type: "DELETE", url: this.uri, dataType: "json",
complete: function(req) {
var resp = $.httpData(req, "json");
- if (req.status == 202 && options.success) {
- options.success(resp);
+ if (req.status == 202) {
+ if (options.success) options.success(resp);
} else if (options.error) {
options.error(req.status, resp.error, resp.reason);
} else {
@@ -91,8 +91,8 @@
type: "GET", url: this.uri, dataType: "json",
complete: function(req) {
var resp = $.httpData(req, "json");
- if (req.status == 200 && options.success) {
- options.success(resp);
+ if (req.status == 200) {
+ if (options.success) options.success(resp);
} else if (options.error) {
options.error(req.status, resp.error, resp.reason);
} else {
@@ -109,8 +109,8 @@
dataType: "json",
complete: function(req) {
var resp = $.httpData(req, "json");
- if (req.status == 200 && options.success) {
- options.success(resp);
+ if (req.status == 200) {
+ if (options.success) options.success(resp);
} else if (options.error) {
options.error(req.status, resp.error, resp.reason);
} else {
@@ -128,8 +128,8 @@
dataType: "json",
complete: function(req) {
var resp = $.httpData(req, "json");
- if (req.status == 200 && options.success) {
- options.success(resp);
+ if (req.status == 200) {
+ if (options.success) options.success(resp);
} else if (options.error) {
options.error(req.status, resp.error, resp.reason);
} else {
@@ -155,8 +155,8 @@
var resp = $.httpData(req, "json")
doc._id = resp.id;
doc._rev = resp.rev;
- if (req.status == 201 && options.success) {
- options.success(resp);
+ if (req.status == 201) {
+ if (options.success) options.success(resp);
} else if (options.error) {
options.error(req.status, resp.error, resp.reason);
} else {
@@ -173,8 +173,8 @@
dataType: "json",
complete: function(req) {
var resp = $.httpData(req, "json");
- if (req.status == 202 && options.success) {
- options.success(resp);
+ if (req.status == 202) {
+ if (options.success) options.success(resp);
} else if (options.error) {
options.error(req.status, resp.error, resp.reason);
} else {
@@ -201,8 +201,8 @@
data: toJSON(body), dataType: "json",
complete: function(req) {
var resp = $.httpData(req, "json");
- if (req.status == 200 && options.success) {
- options.success(resp);
+ if (req.status == 200) {
+ if (options.success) options.success(resp);
} else if (options.error) {
options.error(req.status, resp.error, resp.reason);
} else {
@@ -218,8 +218,8 @@
dataType: "json",
complete: function(req) {
var resp = $.httpData(req, "json");
- if (req.status == 200 && options.success) {
- options.success(resp);
+ if (req.status == 200) {
+ if (options.success) options.success(resp);
} else if (options.error) {
options.error(req.status, resp.error, resp.reason);
} else {
@@ -237,8 +237,8 @@
type: "GET", url: "/", dataType: "json",
complete: function(req) {
var resp = $.httpData(req, "json");
- if (req.status == 200 && options.success) {
- options.success(resp);
+ if (req.status == 200) {
+ if (options.success) options.success(resp);
} else if (options.error) {
options.error(req.status, resp.error, resp.reason);
} else {
@@ -256,8 +256,8 @@
contentType: "application/json",
complete: function(req) {
var resp = $.httpData(req, "json");
- if (req.status == 200 && options.success) {
- options.success(resp);
+ if (req.status == 200) {
+ if (options.success) options.success(resp);
} else if (options.error) {
options.error(req.status, resp.error, resp.reason);
} else {