SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2003
    Location
    Leuven, Belgium
    Posts
    78
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    repairing back button with refreshing iframe in ie

    I wrote a very fun little script that uses a self-refreshing iframe to update itself - only problem is, in ie, this screws up the back button - back button returns the previous iframe, and not the previous page (as do firefox, opera, and konqueror). Anyone know how I could kluge for ie with a javascript, so the back button isn't broken like this, and it returns the previous full page, and not just the previous iframe?

  2. #2
    SitePoint Enthusiast
    Join Date
    Feb 2003
    Location
    Leuven, Belgium
    Posts
    78
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Think I got the answer, posting here in case others have similar question:
    it uses window.location.replace() -
    http://grizzlyweb.com/webmaster/javascripts/refresh.asp#version2

  3. #3
    SitePoint Evangelist IJoeR's Avatar
    Join Date
    Feb 2003
    Location
    Somewhere in, MD
    Posts
    400
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think this script can certainly help me, but i have one question.

    Here is what I'm doing...I have a validation that checks to see if a user is logged in already. If they are then can go right in, if they aren't then they get the fields to enter there username / password. Here is the problem. When the user clicks the Login link, the browser hits this validation page and then shoots on over to the u/p form. Some people like to hit the back button and if they do they keep getting validated. So, what to do in this...I want the browser to do the validation, but i don't want it to register the page in the "BACK" button history. Dig?

    Can someone help?

    I also don't need the page refrshing constantly.

  4. #4
    SitePoint Evangelist
    Join Date
    Sep 2003
    Location
    San Diego, CA
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    On the validation page, redirect your user by using....
    Code:
    page="PageYouWantItToGoTo.php"
    window.location.replace(page);
    It will not add that page to the history and the back button!

  5. #5
    SitePoint Evangelist IJoeR's Avatar
    Join Date
    Feb 2003
    Location
    Somewhere in, MD
    Posts
    400
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cool...I will certainly give that a try.

    I'm searching the internet for a the javascript code that accesses the browser back button. Do you know what the code is for that?

  6. #6
    SitePoint Evangelist
    Join Date
    Sep 2003
    Location
    San Diego, CA
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this will act as the browsers back button....
    Code:
    function GoBack(){
         document.location="javascript:history.back(1);"
    }


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
  •