javascript - How do I load a specific url on refresh? -
let's decides press f5 or browser's reload button. possible open specific url in same tab?
like posted in comment, if display prompt, possible using following ugly hack:
var a,b; window.onbeforeunload = function (e) { if (b) return; = settimeout(function () { b = true; window.location.href = "//test.com"; }, 500); return "now redirected new page if choosing stay there..."; } window.onunload = function () { cleartimeout(a); }
Comments
Post a Comment