Test case for jQuery Ticket 8305
other cache call
by jitter
HTML
<div id="log"></div>
JavaScript
$.ajaxPrefilter(function(options, originalOptions, jqXHR) {
if (!options.cache && options.oraclePLSQLCall) {
options.cache = true;
options.url += (/\?/.test(options.url) ? "&" : "?") + options.oraclePLSQLCall + "=" + jQuery.now();
}
});
//or if you want the "cache parameter" at the end
/*
$.ajaxPrefilter(function(options, originalOptions, jqXHR) {
if (!options.cache && options.oraclePLSQLCall) {
options.cache = true;
var anticache = options.oraclePLSQLCall + "=" + jQuery.now();
if (options.data) {
options.data += "&" + anticache;
} else {
options.data = anticache;
}
}
});
*/
$.ajax({
url: "/echo/js/",
dataType: "html",
cache: false,
oraclePLSQLCall: "customanticache",
data: {
js: "<h1>FOO</h1>"
},
success: function(data) {
$("#log").html(data);
}
});