3

I have seen blogspot blogs auto forward to a different url(different blog) when manually stop the loading process of a webpage while it is being loaded. Some template designers create templates like that if a blog which uses their template, is disturbed while it is being loaded, it automatically get forwarded into the designer's blog (by disturb I mean manually stop the page loading process by clicking the 'stop loading button' in url bar). I've seen this happens in Firefox browser most of the times, but not in Chrome. I want to know how to do such an auto forwarding to another url when the loading process of a webpage is manually stopped while it is being loaded. And how to stop a blog being auto forwarded to any other site when a blog's page loading process is manually stopped while loading. What is the code for that?

Thank you very much!

Found this code parts from net with the help of comments, I think this code has something to do with it. If anyone knows how to do what I asked, with this code please help.

window.onbeforeunload = onbeforeunload_Handler;
function onbeforeunload_Handler() { 
  window.location = "URL";
}

document.onstop = OnStopDocument;
function OnStopDocument () {
  window.location = "URL";
}

window.onunload = onunload_Handler;
function onunload_Handler() { 
  window.location = "URL";
}
Aᴍɪʀ
  • 7,623
  • 3
  • 38
  • 52
slbgdp
  • 203
  • 3
  • 11
  • 1
    Possible duplicate of [JavaScript - detect browser stop button click](http://stackoverflow.com/questions/5357342/javascript-detect-browser-stop-button-click) – Aᴍɪʀ Dec 24 '15 at 23:13
  • 1
    Or this one: http://stackoverflow.com/questions/7728158/any-javascript-event-occuring-when-user-clicks-stop-load-button – Aᴍɪʀ Dec 24 '15 at 23:17
  • This relates to my problem but it doesn't cover my problem. It says it is done by 'document.onstop' event in Internet Explorer and only in Internet Explorer. It says it doesn't work with any other browsers. But I've seen this auto forwarding to another urls when loading process manually stopped happens in firefox browser. So if document.onstop event doesn't work in firefox what might be used to do that in firefox? – slbgdp Dec 24 '15 at 23:29
  • I believe you could find the solution on those links for firefox, if there is a solution. Can you bring an example of such forwardings in Firefox? – Aᴍɪʀ Dec 24 '15 at 23:38
  • I deleted the reply to above on your request and added it to the question. – slbgdp Dec 25 '15 at 00:44
  • That's better :) I'll do a little bit of research. Hopefully someone knowledgeable will answer your question before me. – Aᴍɪʀ Dec 25 '15 at 00:47
  • Thank you very much! These events are new to me. – slbgdp Dec 25 '15 at 01:01

0 Answers0