bonaca bonaca - 3 months ago 6
Ajax Question

how to reload a page using ajax success function

admin.php

$.ajax({
...
success: function() {
location.href = "admin.php";
}
});


As a result I should get some new content added to the page (
admin.php
), but sometimes the page is not reloaded and I can see the new content only after pressing F5 key.

Any help?

Answer

Your success function should be:

success: function() {
  location.reload();
}
Comments