Can anyone explain how to redirect a page to a specific URL upon the user clicked page refresh option . For example if the user is currently in the page http://xxxxxxx.com/something, upon page refresh it needs to be redirected to http://xxxxxxx.com
Asked
Active
Viewed 48 times
-2
-
last resort: just put a `window.location = "http://xxxxxxx.com"` inside the template of `something` – marmeladze Aug 18 '17 at 13:35
-
2Possible duplicate of [How to redirect to another webpage in JavaScript/jQuery?](https://stackoverflow.com/questions/503093/how-to-redirect-to-another-webpage-in-javascript-jquery) – Jon Sampson Aug 18 '17 at 13:36
1 Answers
0
<body onLoad="myRedirectFunction()">
</body>
<script>
myRedirectFunction() {
window.location.assign("http://myRedirectLocation.com");
}
</script>

Pandiya Rajan
- 1
- 1
-
Above one automatically redirects the page to http://myRedirectLocation.com upon loading. i want the page to be directed only when the user manually clicks the refresh option – simbu Aug 18 '17 at 13:58