1
$.ajax({
  url: '/DisplayMissingTables/json/err_data.json',
  dataType: 'json',
  async: false,
  success: function(data) {
    var jsonfile = data;
    console.log(jsonfile);
  }
});

When my json file is updated it still shows the old data. What should I do? I want to display the new data that is updated in the file. Thank you!

SAKTHIVEL N
  • 41
  • 1
  • 5

2 Answers2

0

Try this one

 $.ajax({
      type: "GET"
      url: '/DisplayMissingTables/json/err_data.json',
      dataType: 'json',
      async: false,
      success: function(data) {
        var jsonfile = data;
        console.log(jsonfile);
      }
    });
Jinesh
  • 1,554
  • 10
  • 15
0

Try adding

$.ajaxSetup({ cache: false }); 

It could be getting cached and this would prevent that from happening: How to set cache: false in jQuery.get call

Brian Mains
  • 50,520
  • 35
  • 148
  • 257