window location href and location reload() both redirects a page to a new page but there are some difference to follow.
window.location.href is not a method. It is a property which will tell you the current URL location of the browser. Changing the value of the property will redirect the page.
window.location.href = 'http://www.namasteui.com';
The window.location.reload() method is used to reload the current document. It acts same as the reload button in our browser.
window.location.reload() is supposed to accept the argument that tells to do hard reload from the server by setting the forceGet parameter to true i.e. ignoring the cache.
window.location.reload(true);
Another thing is that window.location.reload() reloads the current page with POST data, whereas window.location.href = window.location.href does not include the POST data.
In a world where digital presence is paramount, the question isn't whether you should do…
Over the years, people have experimented with various methods to maintain healthy and beautiful hair.…
Your brand more than developing an attractive and creative logo and infectious motto. It's the…
Introduction Are you someone who has suffered from a personal injury and want to file…
Operating from home has emerged as one of the most popular ways of doing jobs…
If the consequences of our society’s ever-growing debt are what worries you, then it is…
View Comments
The information you are providing is very helpful for me and other curious readers also. I love to read articles.
Thank You.