0
如何在ReactJS中進行AJAX調用而無需緩存json數據?ReactJS如何在不使用緩存的情況下調用JSON數據?
this.serverRequest = $.get(this.props.source, function (result) {
console.log("after serverRequest");
}.bind(this));
如何在ReactJS中進行AJAX調用而無需緩存json數據?ReactJS如何在不使用緩存的情況下調用JSON數據?
this.serverRequest = $.get(this.props.source, function (result) {
console.log("after serverRequest");
}.bind(this));
這是jQuery的阿賈克斯設置:
全球:
$(document).ready(function() {
$.ajaxSetup({ cache: false });
});
或每個請求:
$.ajax({
cache: false,
url: "/path/to.json",
dataType: "json",
success: function(data) {
...
}
});