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.
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy NS7 doesn't support....

    Hi, I have facing some problem and found that NS7 doesn't support javascript:history.back() or javascript:history.go(-2)

    anyone can help me to solve it?
    many thanks.
    Last edited by suisui; 07-11-2002 at 05:25 AM.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Mumbai, India
    Posts
    218
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello,

    Well, I tested it on NS7 and it does work :
    Code:
    <script>
    document.write('<a href="#" onclick="history.go(-2)">Click</a>');
    </script>
    Well, if there is no page in the history, that's another thing


  • #3
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Also, please refrain from pm-ing mods (ahem, me) for questions that can be asked in the forum. I read the forums too you know.

  • #4
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    premshree,
    no...
    It doesn't work....
    why?

  • #5
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    history.back()

    and

    history.go(-1)

    both work fine in all builds off the Mozilla 1.0 trunk. (Not to mention every single build of Gecko in existance - from what I can quickly tell in BugZilla).

    It is something *else* you are doing, care to post some code?

  • #6
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay, here are the code:

    page 1

    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body bgcolor="#FFFFFF" text="#000000">
    <a href="his_back.htm">link</a>
    </body>
    </html>

    ---------------------------------------------------
    page 2

    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <script>
    document.write('<a href="#" onclick="history.go(-2)">Click</a>');
    </script>
    <BODY>


    </BODY>
    </HTML>

    thanks for helping

  • #7
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    you should have used history.go(-1), since you only need to go 1 (not 2) page back. Or simply history.back()

    Originally posted by suisui
    Okay, here are the code:

    page 1

    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body bgcolor="#FFFFFF" text="#000000">
    <a href="his_back.htm">link</a>
    </body>
    </html>

    ---------------------------------------------------
    page 2

    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <script>
    document.write('<a href="#" onclick="history.go(-2)">Click</a>');
    </script>
    <BODY>


    </BODY>
    </HTML>

    thanks for helping

  • #8
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    no...
    it doesn't work

  • #9
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    ok, i saw what you were doing wrong. put the script inside the body tag. Anchor tag should be inside the body. And also you did not have the </head> tag.

    page 2

    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    </HEAD>
    <BODY>
    <script>
    document.write('<a href="#" onclick="history.go(-1)">Click</a>');
    </script>
    </BODY>
    </HTML>

  • #10
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    no....
    it doesn't go back to history page too...

  • #11
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    did you copy & paste the code I made?
    can you see the Back button enabled in the toolbar?
    can you post the codes (again) you were executing.

  • #12
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    page 1

    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body bgcolor="#FFFFFF" text="#000000">
    <a href="his_back.htm">link</a>
    </body>
    </html>
    ===============================

    page 2

    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    </head>
    <BODY>
    <a href="javascript:history.back()">Back</a>
    </BODY>
    </HTML>


    ==============================
    thanks for helping.

    suisui

  • #13
    Regular Coder
    Join Date
    Jul 2002
    Location
    U.S. (Wish Japan though)
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Don't put the jabascript tag in there.... do what glenngv put like this

    Page 2:

    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    </head>
    <BODY>
    <script>
    document.write('<a href="#" onclick="history.back()">Back');
    </script>
    </BODY>
    </HTML>

  • #14
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm using Netscape 7.0 Preview Release 1, duno why ... still can't work with history.back()...

  • #15
    Regular Coder
    Join Date
    Jul 2002
    Location
    U.S. (Wish Japan though)
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I must really be out of it.. I forgot the </a>

    Code:
    <script> 
    document.write('<a href="#" onclick="history.back()">Back</a>'); 
    </script>


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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