SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How I can detect if some one hit the refresh button in the browser?

    Hi all,

    I set up a pop up page to appear when some one leave the site by calling 'window.open' in the onload in the <body> tag.
    every thing is working fine a part from when I hit refersh button of back/forward buttons in the browser the pop up page appear?

    Any ideas how to avoid that from happining

    Thanks

    Salah

  2. #2
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Probably best to set a cookie that says the popup has been launched...
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  3. #3
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    hmmm

    I'm not going to spend too long going into this... but:

    Each function recieves an event handler reference.
    Use the event properties to find out what caused the refresh.

    window.event.srcElment might be instrumental for you here.

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  4. #4
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I knew it was around here somewhere: http://sitepointforums.com/showthrea...refresh+button
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky


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
  •