Page 1 of 1
When I leave a site
Posted: Fri Feb 02, 2007 9:53 am
by moiseszaragoza
I was trying to find out if there is a way to triger a event when then the user leaves the web site
I have looked in unload on a frame but that it not working from a SEO stand point and site user friendly
Thanks
Posted: Fri Feb 02, 2007 10:53 am
by RobertGonzalez
Javascript, I believe is the only way to determine loss of focus or the movement away from a site.
Posted: Fri Feb 02, 2007 11:20 am
by jyhm
Everah wrote:Javascript, I believe is the only way to determine loss of focus or the movement away from a site.
Code: Select all
<script type="text/javascript" language="Javascript">
<!-- Hide from older browsers
window.onunload=laterDude;
function laterDude() {
alert("Yo! You leaving? Hmmf, like I care, later dude!");
}
// Stop Hiding -->
</script>
Posted: Fri Feb 02, 2007 12:09 pm
by moiseszaragoza
by any chance do you know how to check when they are leaving the site not each page
thanks
Posted: Fri Feb 02, 2007 12:13 pm
by jyhm
moiseszaragoza wrote:by any chance do you know how to check when they are leaving the site not each page
thanks
Mmmm, not sure. Anything to do with the window is clientside thus delt with by javascript. Maybe some sort of session class but that depends on what exactly you are doin. Of course I might be speakin' out my arse.
