how to detect page reload in javascript code example Example: reload page javascript window.location.reload();