SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    May 2006
    Posts
    457
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    code that triggers when users moves from page

    HI all, im looking for some code that will trigger when a user clicks from one page on my website to another.

    i.e. a function that will trigger each and every time the user clicks on a link that takes them away from the current page.

    Any ideas?

  2. #2
    SitePoint Enthusiast
    Join Date
    Sep 2005
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,
    either you use "onUnLoad" to perform an action when the page is closed by the user or you use "onBlur". This will trigger when the user's focus shifts to another page.

    This is all you need

    Cheers, Florian

  3. #3
    SitePoint Aficionado JVLB's Avatar
    Join Date
    Jan 2002
    Location
    N 44 56.537' W 123 3.683'
    Posts
    1,127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Note that onunload doesn't allow much time for code to be executed, so your script that is so triggered must be very brief, or it simply will be dumped before it finishes executing.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •