capture destination URL in onUnload

  • Thread starter Isaac Fig Newton
  • Start date
I

Isaac Fig Newton

for use on Intranet, need to identify when user leaves the Intranet,
and have that trigger a function (on a new asp page) to use session
variables to do an update.

I have something that identifies when a user closes their browser,
but not when they simply leave the site for another site (complete
with testing alerts to verify each stage):

<script language="JavaScript" type="text/JavaScript">
<!--
function openAVWindow() {
// grab window position to determine if browser has been closed. grab
URL
var win = this;
{
var winpos = win.event.clientX;
alert("winpos = " + winpos);
var exiturl = document.location.href;
alert("exiturl = " + exiturl);
}
// if winpos is negative (browser was closed) open window to insert
exit
values into AuditView
if (winpos < 0)
{

window.open('/inc/UpdateAVUser.asp?AVID=<%=AVAuditViewID%>','AVUpdate','resi
zable=0,status=1,scrollbars=1,location=1,toolbar=1','width=10,height=10');
alert("popup = yes" + exiturl);
}
}
//-->
</script>
 
J

Jim Ley

for use on Intranet, need to identify when user leaves the Intranet,
and have that trigger a function (on a new asp page) to use session
variables to do an update.

Can't be done, I'm sure it's easier to just fix your server handling -
after all when the network goes down, or the person undocks their
laptop, you'll be in the same lost situation.

http://jibbering.com/faq/#FAQ4_29

Jim.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top