Reputation: 9293
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?
Upvotes: 2
Views: 17954
Reputation: 3171
Your success function should be:
success: function() {
location.reload();
}
Upvotes: 4
Reputation: 659
you can call all the ajax method which are responsible to load the initial DOM on load. No need to refresh the page again.
function load(){
$.ajax({
...
success: function() {
//location.href = "admin.php";
load();
}
});
}
load();
Something like above.
Upvotes: 1
Reputation: 26258
Try this:
success: function() {
location.reload(); // to reload the same page again
window.location.href = "admin.php"; // to go to a new url
}
Upvotes: 2