There are various of doing so as mentioned below :-
JS 1.0
window.location.href = window.location.pathname;
// This creates a history entry
If location.href is used to come to the page then we can reload the same page as below as well :-
onClick="history.go(0)"
JS 1.1
window.location.replace(window.location.pathname);
// This does not create a history entry
JS 1.2
window.location.reload(false);
The reload() function takes an optional parameter that can be set to true to reload from the server rather than the cache. The parameter defaults to false, so by default the page reloads from the browser's cache.
You can also reload the page by again setting the current page URL to current page URL.
Ex :-
onClick="window.location.href=window.location.href"
Hope this will definitely be of help to you.