SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    Ann Arbor, MI
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    That darn Back button

    The site that I'm currently working on is related to a computer game, and I'm creating an interface similar to the game using js for rollovers and imagery changes.

    However, one thing that web browsers have that the game doesn't is a "Back" button. I don't want to disable it--I hate when sites do that--but I want to makes sure that button changes that happen going forward also happen going backward.

    That said:

    1: Is there any way to force a function to run when the back button is pressed? And if not...

    2: Does the body onLoad event work when the page is returned to using the back button?

    Thanks in advance,

    LL (Eric)

  2. #2
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    onUnload would call a function when the back button is pressed, though the user would be "gone".

    onLoad is called whenever a page's information is requested from the server. Thus, a soft-back won't qualify.
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    Ann Arbor, MI
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by studiococo
    onUnload would call a function when the back button is pressed, though the user would be "gone".
    That should be fine... the stuff that has to happen is in a completely sepsrate frame. I'll check it out, see if it works. Thanks, coco.

    LL

  4. #4
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    no worries
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright


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
  •