Window.location.href and location.reload () does not load the updated page from the server

I have a form that updates on an AJAX call.

After the Ajax call succeeded, I want to reload the same page to reflect the new changes.

I used location.reload() and window.location.href after calling AJAX, the correct RELOAD is executed in the browser, but the form shows the old data, not the new one.

If I reload the page using the browser reload button, new updated data is displayed.

But how to properly load a page using jQuery?

+7
javascript jquery ajax
source share
1 answer

The reload(forcedReload) method accepts a boolean flag that, when true, forces the page to always reload from the server. If it is incorrect or not specified, the browser can reload the page from its cache.

Try:

 // Reload the current page, without using the cache document.location.reload(true); 
+6
source share

All Articles