summaryrefslogtreecommitdiff
path: root/share/www
diff options
context:
space:
mode:
authorRobert Newson <rnewson@apache.org>2011-05-23 09:51:04 +0000
committerRobert Newson <rnewson@apache.org>2011-05-23 09:51:04 +0000
commitee6bb16b53069e6b213d1314f78cde2bd648b069 (patch)
tree8467fdb041c030c82ab75162ca9a33c16976875c /share/www
parent6f2e87fb5a36bece84a9df3d0cd5c7b87ec60bce (diff)
COUCHDB-1156 - send Accept header so Futon doesn't display HTML where it expects JSON (Thanks Dale Harvey for patch)
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1126411 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www')
-rw-r--r--share/www/script/jquery.couch.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/share/www/script/jquery.couch.js b/share/www/script/jquery.couch.js
index edae18fc..9bc1363b 100644
--- a/share/www/script/jquery.couch.js
+++ b/share/www/script/jquery.couch.js
@@ -624,8 +624,14 @@
};
function ajax(obj, options, errorMessage, ajaxOptions) {
+
+ var defaultAjaxOpts = {
+ contentType: "application/json",
+ headers:{"Accept": "application/json"}
+ };
+
options = $.extend({successStatus: 200}, options);
- ajaxOptions = $.extend({contentType: "application/json"}, ajaxOptions);
+ ajaxOptions = $.extend(defaultAjaxOpts, ajaxOptions);
errorMessage = errorMessage || "Unknown error";
$.ajax($.extend($.extend({
type: "GET", dataType: "json", cache : !$.browser.msie,