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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onUnload question

Status
Not open for further replies.

antweb

Programmer
Jun 23, 2003
2
GB
hi,

I am trying to trigger a customer satisfaction survey when users leave our site. how do I access the URL that the user is trying to go to during the onUnload event?

many thanks
 
I should have been more explicit - I'm trying to detect when a user leaves my site so they can randomly be asked if they would like to take a customer satisfaction survey.

the answers I have found so far all involve setting a flag to prevent an onUnload function from running when you follow internal links on the site. the easiest way I found was to do this:

<body onUnLoad=&quot;survey();&quot; onMouseDown=&quot;flag();&quot;>

so that the survey is only run when a user leaves the URL. the only down side is this only seems to work in v6 browsers, but I dont want to add the js to every single link so I don't have much choice
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top