So why not just load it in the footer? Share Improve this answer Follow edited Feb 13, 2020 at 6:15 answered Feb 13, 2020 at 5:19 Jamil Ahmed In your ajax success callback do this: success: function (data) { if (data.success == true) { // if true (1) setTimeout (function () {// wait for 5 secs (2) location.reload (); // then reload the page. Do you need your, CodeProject, Manage Settings You'll get a notification every time a post gets published here. In your ajax success callback do this: success: function (response) { setTimeout (function () { location.reload () }, 5000); } As you want to reload the page after 5 seconds, then you need to have a timeout as suggested in the answer. Seems like poor UI. The second way to refresh is to use partial loading and it loads only those areas that have been changed. But where does the second XHR come from, and how to prevent from this? What does Ajax$.load do in jQuery? Long-lived connections (asynchronous server push) with Apache/PHP/Javascript. if you dont want to reload,use $ ('.modal-backdrop').remove (); to remove the backdrop. How do you refresh modal after Ajax success? We and our partners use data for Personalised ads and content, ad and content measurement, audience insights and product development. The first way to reload is the whole page that means you have to refresh the entire page. Instead I could have focused on stopping the AJAX call reaching the controller. We need more code in any case. Like I said, try to find the enqueue handler of the script that binds the events. When the user clicks the element with class trigger and the Ajax request completes, the log message is displayed.. All ajaxComplete handlers are invoked, regardless of what Ajax request was completed. Comment * document.getElementById("comment").setAttribute("id","a4af4c01e20c651bd5d94c46d212d9fe");document.getElementById("ce38566e80").setAttribute("id","comment"); Your email address will not be published. Redirect to new page after jQuery AJAX call is successful (completed) The following HTML Markup consists of an HTML Button assigned with a jQuery OnClick event handler. It helps display up-to-date CRUD operations. Jquery refresh page after ajax success with 5 seconds, 3. When to run reload refresh function in JavaScript? The content of the page can be reloaded by using different jQuery Ajax methods. Asserts are javascript, HTML, and style from a server. I mean, the code works, but not good. You can use the reload function in your if condition for success and the page will reload after the condition is successful. How to manage a redirect request after a jQuery Ajax call, Best way to use Google's hosted jQuery, but fall back to my hosted library on Google fail. What can a lawyer do if the client wants him to be acquitted of everything despite serious evidence? Right now, I'm not sure why but I have to reload the whole cart page for the notification to show up (see picture). Do roots of these polynomials approach the negative of the Euler-Mascheroni constant? How can I upload files asynchronously with jQuery? Jquery refresh page after ajax success without 5 seconds, 4. Did any DOS compatibility layers exist for any UNIX-like systems before DOS started to become outmoded? In this tutorial, We will see theJquery refresh page after 5 seconds. If so, how close was it? 28. contentType:'application/json;charset=utf-8', ,