Fix compatibility with jQuery 1.9+ $.browser is gone there, but still we have to disable cache for MSIE.
COUCHDB-1668 Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/5310b408 Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/5310b408 Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/5310b408 Branch: refs/heads/1744-single-config-file Commit: 5310b4087b69ae4df496d00bc77a3e258888c71a Parents: 3097e8c Author: Alexander Shorin <[email protected]> Authored: Sun Dec 8 20:32:53 2013 +0400 Committer: Alexander Shorin <[email protected]> Committed: Sun Dec 8 20:32:53 2013 +0400 ---------------------------------------------------------------------- share/www/script/jquery.couch.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/5310b408/share/www/script/jquery.couch.js ---------------------------------------------------------------------- diff --git a/share/www/script/jquery.couch.js b/share/www/script/jquery.couch.js index b7e36f9..db4e8ef 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);
