Any javascript event occuring when user clicks Stop load button?

Internet Explorer has a document. Onstop event that is fired, but other browsers don't seem to support that. Note that it's fired when the user clicks Stop or hits Esc, OR if the user navigates to another page during page load, which has the same effect.

Internet Explorer has a document. Onstop event that is fired, but other browsers don't seem to support that. Note that it's fired when the user clicks Stop or hits Esc, OR if the user navigates to another page during page load, which has the same effect.

I don't believe there is a reliable way to trigger an event on clicking Stop in other browsers. Perhaps it would be possible to do something like: keeping the connection to the server open (as in the Comet approach), streaming some sort of keep-alive down the connection, and detecting if the stream ends (as I assume it would if the Stop button were clicked).

Thanks. For my specific case I only have to support IE, so onstop should do the trick. – Nilzor Oct 11 at 16:41 Well after further testing onstop seems to be not quite what I need after all.It also fires when navigating away from your page, and only once.

So if the sequence is like 1. Navigate away, 2. Cancel navigation, onstop only fires on the first event - oppsite of my need.

– Nilzor Oct 12 at 8:56 When you navigate away, that cancels loading of the page you were on. If you then click Stop, that will cancel loading of the new page. I would expect there to be two onstop events fired, but for different documents.

– JacobM Oct 12 at 13:52 Yea, you're probably right. Even if that new page is not done loading yet. I think I'll rethink the whole concept of what I'm trying to do, avoiding the need for this event.

– Nilzor Oct 12 at 17:55.

There isn't any cross browser way of doing this. However, IE has a special event, onstop which occurs on the body when the stop button is pressed. You cannot override the stop button functionality (that is, you cannot cancel it), but you can detect that it has happened in IE.

If it's images that are still getting loaded on the page, you can use the onabort event to monitor for the stop load. Monitoring for the mouse click should be impossible, as it doesn't happen inside the current browsing window.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions