Tuesday, June 25, 2019

javascript - How can I refresh a page with jQuery?




How can I refresh a page with jQuery?


Answer



Use location.reload():



$('#something').click(function() {
location.reload();
});



The reload() function takes an optional parameter that can be set to true to force a reload from the server rather than the cache. The parameter defaults to false, so by default the page may reload from the browser's cache.


No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...