Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

268
Views
Using old version of JSON when the JSON is updated and the page is refreshed

I have question about JSON and JavaScript. So through web page I update JSON file and then save it to the server. Then I go to the page where there must be listed the information from the JSON but it visualisates the old information of the JSON even after refreshing the page. Only when I open a new window of web browser then it list the latest JSON. I search for any cache but there is nothing and don't know where is the problem. So how to visualisate the updated JSON after refreshing page?

I am fethching the information by jQuery:

$.getJSON("json2.json", function(json) {
console.log(json[0]); // this will show the info it in firebug console
var count = Object.keys(json).length;
console.log(count);
for(var i=0; i<count; i++){}});

This is no the full code but i can't publish it all because it so long.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

This is probably due to browser cache, since this is the same filename.

Add this before your $.getJSON(...:

$.ajaxSetup({
    cache:false
});

;)

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!