SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: history.go

  1. #1
    SitePoint Enthusiast red60man's Avatar
    Join Date
    Nov 2004
    Location
    portland
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb history.go

    how do i go to a specific page

    i tried these but with no result


    Code:
    <a href="javascript:history.go('WebForm1.aspx');">Go back</a>

    thanks
    red

  2. #2
    Free Geek computerages's Avatar
    Join Date
    Oct 2004
    Location
    /dev/null
    Posts
    1,071
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by red60man
    how do i go to a specific page

    i tried these but with no result


    Code:
    <a href="javascript:history.go('WebForm1.aspx');">Go back</a>

    thanks
    red
    Did you get any error message? If so, then post it here.

  3. #3
    SitePoint Enthusiast red60man's Avatar
    Join Date
    Nov 2004
    Location
    portland
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No error message actually the link doest do anything it just changes the forecolor indicating that it was hit .........but doesnt do anything

    red

  4. #4
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    According to MSDN:

    http://msdn.microsoft.com/library/de...ce/methods.asp

    The parameter for go() can be either an integer or a string that is an exact URL in the History list.

    "WebForm1.aspx"

    doesn't look like a URL to me, so try something else. One thing you can try is: load "WebForm1.aspx" into your browser and then copy and paste what's in the browser's address bar, and use that as your "exact url".

  5. #5
    SitePoint Enthusiast red60man's Avatar
    Join Date
    Nov 2004
    Location
    portland
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation

    if i past full url it is working but it is recreating the page ....ie., my webFrom1.aspx pageload event i being fired....which doesnt happen if i just press the back button of the browser

    the reason i was trying to use history.go is to get the functionality of the browser's back button

    like history.back(-1) or history.go(-1) will do exactly as the browsers back button

    thanks
    red

  6. #6
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    my webFrom1.aspx pageload event i being fired....which doesnt happen if i just press the back button of the browser
    That can't be true, and I just tested it in IE6 and FF1.0, and when I use the back button on either of those browsers, the onload event for the previous page fires.

  7. #7
    SitePoint Zealot
    Join Date
    Dec 2004
    Location
    Finland
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by 7stud
    That can't be true, and I just tested it in IE6 and FF1.0, and when I use the back button on either of those browsers, the onload event for the previous page fires.
    Maybe he's using Opera which doesn't fire onload/onunload events when using back/forward buttons.


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
  •