Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Back and Foward.

  1. #1
    Join Date
    Sep 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Back and Foward.

    I have this code in my page
    <td><form><input type ="Button" VALUE = "back" onclick="history.go(-1)"></form></td>

    <form><input type ="Button" VALUE = "Forward" onclick="history.go(+1)"></form>

    they make a NICE Back and Foward button... but my customer wants a IMAGE instead... How do I do that ?

  2. #2
    Join Date
    Sep 2004
    Location
    Little Falls, Roodepoort, South Africa
    Posts
    421
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    <IMG style="CURSOR: hand" onclick=history.back()
    height=17 alt="Back to Previous Page"
    src="images/but_previous.jpg" width=81 border=0>

  3. #3
    Join Date
    Sep 2004
    Location
    Indonesia
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    This will work too:

    <a href=# onClick="history.go(-1)"><img src="images/back.gif" alt="back"></a>
    <a href=# onClick="history.go(+1)"><img src="images/forward.gif" alt="forward"></a>

  4. #4
    Join Date
    Jul 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question

    I have tried the code suggested in these replies and also tried adjusting it in various ways to get my back button to work and it just wont

    this is the original HTML to take me to a specific page

    <td><a href="../../garments.htm" target="_top" onClick="MM_nbGroup('down','group1','back','../../Images/Buttons/back3.gif',1)" onMouseOver="MM_nbGroup('over','back','../../Images/Buttons/back2.gif','',1)" onMouseOut="MM_nbGroup('out')"><img src="../../Images/Buttons/back1.gif" alt="" name="back" width="116" height="70" border="0" onload=""></a></td>

    This was ok when you could only access the page from one point but now it can be accessed from various places within the website its no good and i need it to be a smple 'Back' button

    can you tell me what i need to do to achieve this please

  5. #5
    Join Date
    Dec 2004
    Posts
    157
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    they can't just use the back/forward button on the brower?

  6. #6
    Join Date
    Jul 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yes but this is a part of the navigation bar and ease of navigation helps to make a site user freindly

  7. #7
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    <a href="javascript:history.go(-1);">Back</a>
    <a href="javascript:history.go(1);">Forward</a>
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  8. #8
    Join Date
    Jul 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Its not working

    All i get when i click on the link is

    Not Found
    The requested URL /Garments/Household/"javascript:history.go(-1);">Back was not found on this server.

    Which is what was happening before.

  9. #9
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by darco9x2
    they can't just use the back/forward button on the brower?
    Quote Originally Posted by delvin
    Yes but this is a part of the navigation bar
    What difference does that make?

    Darco is absolutely right. The browser already provides this feature, and it does so reliably and consistently. An author cannot hope to acheive that, so don't try.

    and ease of navigation helps to make a site user freindly
    Reimplementing a standard feature badly does nothing but harm usability.


    Quote Originally Posted by Twey
    <a href="javascript:history.go(-1);">Back</a>
    <a href="javascript:history.go(1);">Forward</a>
    At the very least you should have suggested that the OP include that using a document.write call so that users without scripting support don't get links that do nothing (or worse, indicate an error as they don't recognise the javascript: pseudo-scheme).

    Mike

  10. #10
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Quote Originally Posted by Mike
    At the very least you should have suggested that the OP include that using a document.write call so that users without scripting support don't get links that do nothing (or worse, indicate an error as they don't recognise the javascript: pseudo-scheme).
    You're right, of course.
    HTML Code:
    <script type="text/javascript">
    document.write('<a href="javascript:history.go(-1);">Back</a> ');
    document.write('<a href="javascript:history.go(1);">Forward</a>');
    </script>
    I also agree that creating your own navigation bar is useless.
    The requested URL /Garments/Household/"javascript:history.go(-1);">Back was not found on this server.
    Sounds like you've missed a quote somewhere.
    Last edited by Twey; 08-21-2005 at 09:25 PM.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •