You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2011/05/23 11:51:04 UTC

svn commit: r1126411 - /couchdb/branches/1.1.x/share/www/script/jquery.couch.js

Author: rnewson
Date: Mon May 23 09:51:04 2011
New Revision: 1126411

URL: http://svn.apache.org/viewvc?rev=1126411&view=rev
Log:
COUCHDB-1156 - send Accept header so Futon doesn't display HTML where it expects JSON (Thanks Dale Harvey for patch)

Modified:
    couchdb/branches/1.1.x/share/www/script/jquery.couch.js

Modified: couchdb/branches/1.1.x/share/www/script/jquery.couch.js
URL: http://svn.apache.org/viewvc/couchdb/branches/1.1.x/share/www/script/jquery.couch.js?rev=1126411&r1=1126410&r2=1126411&view=diff
==============================================================================
--- couchdb/branches/1.1.x/share/www/script/jquery.couch.js [utf-8] (original)
+++ couchdb/branches/1.1.x/share/www/script/jquery.couch.js [utf-8] Mon May 23 09:51:04 2011
@@ -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,