[SOLVED] Problem with Randome Quote Generator

Hi all!
I don’t understand why my scrip not get new quote from API?
Then i refresh hard (Ctrl + F5) vy page i get new quote, but then i click on the button my script not get new jsop object.

I think i need clear page cache, but it is not fix my problem.

Also then i test my page with open debuger all works fine.

Try using .ajax() instead of .getJSON(). It allows you to disable caching. The syntax is a bit more involved, but not that complex:

$.ajax({
  url: 'https://...',
  cache: false,
  success: function(data) {
    // your callback function here...
  }
);
1 Like

thanks. it’s fix problem.