summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Shorin <kxepal@apache.org>2013-12-08 20:32:53 +0400
committerAlexander Shorin <kxepal@apache.org>2013-12-08 20:32:53 +0400
commit5310b4087b69ae4df496d00bc77a3e258888c71a (patch)
tree7a3f9bfee41c0effa03e89e3eacb2765758fb11e
parent3097e8cdd53cff91c4401863a6197c5d4ce9dd86 (diff)
downloadcouchdb-5310b4087b69ae4df496d00bc77a3e258888c71a.tar.gz
Fix compatibility with jQuery 1.9+
$.browser is gone there, but still we have to disable cache for MSIE. COUCHDB-1668
-rw-r--r--share/www/script/jquery.couch.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/share/www/script/jquery.couch.js b/share/www/script/jquery.couch.js
index b7e36f9ae..db4e8efdc 100644
--- a/share/www/script/jquery.couch.js
+++ b/share/www/script/jquery.couch.js
@@ -977,7 +977,7 @@
errorMessage = errorMessage || "Unknown error";
timeStart = (new Date()).getTime();
$.ajax($.extend($.extend({
- type: "GET", dataType: "json", cache : !$.browser.msie,
+ type: "GET", dataType: "json", cache : maybeUseCache(),
beforeSend: function(xhr){
if(ajaxOptions && ajaxOptions.headers){
for (var header in ajaxOptions.headers){
@@ -1058,4 +1058,17 @@
return obj !== null ? JSON.stringify(obj) : null;
}
+ /**
+ * @private
+ */
+ function maybeUseCache() {
+ if (!navigator){
+ return true;
+ }
+ else if (/(MSIE|Trident)/.test(navigator.userAgent)){
+ return false;
+ }
+ return true;
+ }
+
})(jQuery);