couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject svn commit: r1126411 - /couchdb/branches/1.1.x/share/www/script/jquery.couch.js
Date Mon, 23 May 2011 09:51:04 GMT
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,



Mime
View raw message