JavaScript window location reload method enables you to refresh the current URL location. Create a JavaScript function to call the location reload method to to refresh the current location and call the function on click event of HTML element such as button or hyperlink. Otherwise if you will write the code string location.reload() in the JavaScript block placed inside the HTML body then it will cause a problem of inifinite loop of reloading. JavaScript location object belongs to JavaScript window object that allows you to access the reload method using window.location.reload. You can also access the reload method directly as location.reload.
Try the sample below to learn and practice the code functionality of JavaScript window location reload method: