With jQuery ajax method I have a request on some file, which returns data in json format. That request is triggered by clicking on some button. Then I display that data as I need. Everything works fine on localhost, but when I moved my project to the server, there was a little problem. The data, which was updated in database and should be shown in that file (formatted in json), does not update, until I refresh the page.
Here is the code:
function myAjaxFunction() {
$.ajax({
'url' : 'MY_URL',
'type' : 'POST',
'cache' : false,
'data' : 'MY_DATA'
'dataType' : 'json',
'success' : function(result) {
// my code here
}
});
}
var body = $("body");
body.on('click', '.some_button', function(e) {
myAjaxFunction();
e.preventDefault();
});
And I wonder, is that because, I cache body tag?