
September 5th, 2000, 05:18 AM
|
|
Junior Member
|
|
Join Date: Sep 2000
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
I want to use a script to alert users that they are leaving the site. I have used the following script which works with text links but gets confused with an image link does any body know any way around this. I am using the following script.<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
if (document.layers)
document.captureEvents(Event.CLICK);
document.onclick =
function (evt)
{
var target =
document.all ? event.srcElement :
evt.target;
if(target.href.indexOf("yourdomain.com") == -1)
return confirm ('Do you want to leave us for ' + target.href + '?');
return true;
};
// End -->
</SCRIPT>
|