Hello
I am constructing an web app with active server pages, and I wanted to detect when the user leaves my site, either by closing down their web browser or navigating to another site.
I thought that the best way would be to implement client side script to fire on window_onunload, which would open another window with the location of my cleanup page. This would then contain client script to close down as soon as it was rendered, so that it did not annoy the user.
Unfortunately, the window_onunload event seems to fire on the document level, rather than the window level, with the result that every time they move to another page within my site, it performs my cleanup code.
If I can trap just the browser close, I'd be happy. If I could detect when they navigate to a site outside of mine, that would be better still
Any ideas?
This is the kind of code I've been using so far client side
sub window_onunload()
window.open "cleanup.aspx"
end sub
Thanks
Mark
I am constructing an web app with active server pages, and I wanted to detect when the user leaves my site, either by closing down their web browser or navigating to another site.
I thought that the best way would be to implement client side script to fire on window_onunload, which would open another window with the location of my cleanup page. This would then contain client script to close down as soon as it was rendered, so that it did not annoy the user.
Unfortunately, the window_onunload event seems to fire on the document level, rather than the window level, with the result that every time they move to another page within my site, it performs my cleanup code.
If I can trap just the browser close, I'd be happy. If I could detect when they navigate to a site outside of mine, that would be better still
Any ideas?
This is the kind of code I've been using so far client side
sub window_onunload()
window.open "cleanup.aspx"
end sub
Thanks
Mark