couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject svn commit: r1101786 - /couchdb/trunk/share/www/script/jquery.couch.js
Date Wed, 11 May 2011 08:45:55 GMT
Author: rnewson
Date: Wed May 11 08:45:54 2011
New Revision: 1101786

URL: http://svn.apache.org/viewvc?rev=1101786&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/trunk/share/www/script/jquery.couch.js

Modified: couchdb/trunk/share/www/script/jquery.couch.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/jquery.couch.js?rev=1101786&r1=1101785&r2=1101786&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/jquery.couch.js [utf-8] (original)
+++ couchdb/trunk/share/www/script/jquery.couch.js [utf-8] Wed May 11 08:45:54 2011
@@ -1005,8 +1005,14 @@
    * @private
    */
   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