Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jan 2003
    Location
    Illinois
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Calling History On Load

    Can anyone show me the command to interact with the document history on loading a page. I have a project where the user must navigate through several pages, selecting filtering criteria as they go. On the final page, they input the info we need to record. On submission, we use ASP to save the data, then display an "Okay" button and notify them their data was saved. The button uses the document.history function to back them up 3 or more screens to the second page of the site, where they can begin selection criteria again as needed.

    It would be a lot easier if this were done automatically. We save the data before the form displays. It would be easy to call a function onload, but I am not sure of the syntax needed.

    We do not want to use a Redirect command, we want to keep the history intact so when the hit their back button, they are not going back to submitted forms

  • #2
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    well, if i read that correctly, then you want a page that does nothing but send the user back three or four pages.

    if that's what you're looking for, then the following should do what you want:

    <html><head><script>window.onload = function() { history.go(-4); }</script></head></html>

    if that's not what you were looking for ( and i'm pretty sure it's not ) then you're gonna have to explain it again.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #3
    New Coder
    Join Date
    Jan 2003
    Location
    Illinois
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thanks for the reply

    Thanks, that was exactly what I was looking for. We are calling that page to save values entered on the previous page. After all the logic is performed that determines what to save and how to save, we just wanted to take them back to the second welcome screen in the application. From there, if they pressed the back button, we wanted to take them to the screen they were on prior to that. A redirect command would not have done this, that is why we wanted the history function called on load.

    Also, we store a value that records every time they refresh their screen, so the value needed for the history screen would change depending on what was done on the data entry screen.

  • #4
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try using location.replace() which will not load the links into the browser history.

    eg:
    <a href="javascript&#58;location.replace('http://www.yahoo.com')">yahoo</a>

    .....Willy

  • #5
    New Coder
    Join Date
    Jan 2003
    Location
    Illinois
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up Thanks again

    This has become my favored web site, chances are if I am on the internet it is because I am headed here for help. Without the info I receive here, I would probaby be unemployed.

  • #6
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    better make sure your boss and co-workers don't find out where you get your info, or you'll lose your job security. ;D
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.


  •  

    Posting Permissions

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