Results 1 to 8 of 8

Thread: Back button link

  1. #1
    Join Date
    Dec 2006
    Location
    In my home
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Back button link

    1) CODE TITLE: Back button

    2) AUTHOR NAME/NOTES: Yoshi555

    3) DESCRIPTION: Put a back linkyour page

    4) URL TO CODE:
    HTML Code:
    <script>
    <!--
    document.write(unescape("%3Ca%20href%3D%22history.back%281%29%22%3E%20Back%20%3C/a%3E"));
    //-->
    </script>
    To make a forward link on your webpage
    HTML Code:
    <script>
    <!--
    document.write(unescape("%3Ca%20href%3D%22history.forward%281%29%22%3E%20Forward%20%3C/a%3E"));
    //-->
    </script>
    or, ATTACHED BELOW (see #3 in guidelines below):

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Sure... seems like that would work.
    But, really, it's just too simple to be worth much to that many people.
    You're welcome to wait to see if someone else thinks differently.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Dec 2006
    Location
    In my home
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Can you make it into a button i know how but i think if you do it it would be better

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    A button? Based on an image? Or based on an input button?

    <a href="history.back(1)"><img src="button.gif"></a>

    Or, <input type="button" onClick="goback();">

    and

    function goback() {
    document.location = 'history.back(1)';
    }


    Untested... but... generally, that should work.

    Javascript isn't really my area... I do more PHP.
    Last edited by djr33; 01-08-2007 at 03:44 AM.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

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

    Default

    function goback() {
    document.location = 'history.back(1)';
    }

    Untested... but... generally, that should work.
    No it shouldn't
    Code:
    <button onclick="history.back();">Back</button>
    However, I don't see how it merits mentioning. It certainly isn't nearly complex enough to be added to the script archives, in my opinion.

    yoshi555, please validate your code.
    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!

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    There is another issue here, one that mwinter kept raising whenever something like this would come up. It is tempting to use javascript in this fashion but, it renders your navigation sub standard in non-javascript enabled browsers or, even useless if it is depended upon too heavily as will always be the case once a novice or two gets a hold of this code. Good enough reason for me to say, "Don't use it unless you really know what you are doing and above all don't make it a script for novices."
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Yeah... well, I was guessing he actually posted the right thing to use as the url. Oops.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  8. #8
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Yep, this script is definitely too simple to justify staying up. However, since there are a number of replies to the thread already, I'll keep it going.

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
  •