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 3 of 3
  1. #1
    Regular Coder tpeck's Avatar
    Join Date
    Oct 2002
    Location
    Sydney, Australia
    Posts
    877
    Thanks
    53
    Thanked 6 Times in 5 Posts

    history.go(+1) doesn't do it's thing here

    I have another problem that is probably solveable but not with history.go(+1), which is what I would expect.

    I want to be able to go from page 1 to page 2 in two ways.

    You can do it by clicking on the numbers and the back button does its job as you would expect.

    But using the "go" button (enter the lesson number) seems to bypass the back button's history.

    The (cutdown) page demonstrating the problem is here:

    http://aapress.com.au/demo/backforwa...1/001/001.html

    The way the go button works is fine and goes to page 2 nicely from page 1, but no history update.

    It must have something to do with this function in the routine:

    Code:
    function gopage() {
      var ex = document.getElementById('exField').value;
      top.location.replace(getPath(ex));
      return false;
    }
    I tried placing 'history.go(+1)' into that function but it didn't change anything. I don't understand why. (Because of the 'replace'?)
    The difference between genius and stupidity is that genius has its limits. (Albert Einstein)

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Try top.location = getPath(ex); instead.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Regular Coder tpeck's Avatar
    Join Date
    Oct 2002
    Location
    Sydney, Australia
    Posts
    877
    Thanks
    53
    Thanked 6 Times in 5 Posts
    As you can see, that certainly fixed it.

    Many thanks indeed!
    The difference between genius and stupidity is that genius has its limits. (Albert Einstein)


  •  

    Posting Permissions

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