Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can we trigger when user X out of the browser window 1

Status
Not open for further replies.

amirak171

Programmer
Dec 15, 2006
8
CA
can we trigger when user X out of the browser window,

I need to call another page when a user closes the browser window by clicking on the red X (top-right), is there a way we can trigger this event

Thanks in advance
 
Foamcow can you tell me please how exactly will that work. I mean with a code example.
Thanks
 
This is what I use
Code:
<script for=window event=onunload>
    var top=self.screenTop;
    if (top>900) {
  //do function/open new window
    }
</script>

I'm pretty sure it works only in IE. It's also pretty hit or miss. However, it does manage to get by some pop up blockers. Sorry I couldn't give you anything better...I don't require that this functions works 100% of the time, so, I haven't spent much time with it.

Hope that helps some!
Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top