/    Sign up×
Community /Pin to ProfileBookmark

Linking Questions

  • 1.

    What’s the code added if I want to have a link (either a text or an image) when you want to Go back to the Previous linked bookmark within the same page (i think that was kinda redundant)

  • 2.

    What if the link took the viewer to a different/another page but you still want them to be able to go Back to the Previously viewed page or bookmark…without having to click on the Back button of the browser? Is there a way to create a link (text or image -) within that page to go back (in the same window/frame) A sort of Back – Forward button?

  • to post a comment
    HTML

    5 Comments(s)

    Copy linkTweet thisAlerts:
    @Four_of_FiveauthorFeb 04.2003 — [i]Originally posted by Dave Clark [/i]

    [B]Do you mean this?



    <button onclick="window.history.go(-1)">Back</button>

    <button onclick="window.history.go(+1)">Forward</button>



    [b]Dave[/b] [/B]
    [/QUOTE]


  • 1. Thanks! But what if I don't want it to a button (they seem pretty dull) but just a text link or an image link back& forward??


  • 2. Also, does the above also apply to going back to previous view within the same page?
  • Copy linkTweet thisAlerts:
    @CharlesFeb 04.2003 — [font=georgia]Keeping in mind that one in ten times or more JavaScript will not work (http://www.thecounter.com/stats/2002/November/javas.php) we can divide instances of JavaScript use into three categories. Some uses are harmful, some are mostly harmless and some are completely harmless. JavaScript dependent navigation is an example of a harmful use. It will make a site useless for a great number of people. A JavaScript generated date stamp might be an example of a completely harmless use if the date stamp will not be missed by those who do not see it. Your buttons or links fall into the middle category. Nothing is lost if you omit them, but you really do not want all those JavaScript free people to find seemingly broken links on your page. The solution is to use JavaScript to draw those buttons or links.

    [/font][font=monospace]

    <script type="text/javascript">

    <!--

    document.write('<p><a href="#">Get Back Jo-Jo</a> | <a href="#">Onward and Upward</a></p>');

    document.links[document.links.length-2].onclick = function () {history.back(); return false};

    document.links[document.links.length-1].onclick = function () {history.forward(); return false};

    // -->

    </script>[/font]
    Copy linkTweet thisAlerts:
    @zebedeusFeb 05.2003 — the normal text links for that would be:

    <a href="javascript:history.go(-1)">Back</a>

    and

    <a href="javascript:history.go(+1)">Forward</a>


    Of course in stead of the words "Back" and "Forward"

    you can insert any images.

    Zebedeus

    PS... But Charles is right in principle
    Copy linkTweet thisAlerts:
    @StefanFeb 05.2003 — [i]Originally posted by zebedeus [/i]

    <a href="javascript:history.go(-1)">Back</a>

    and

    <a href="javascript:history.go(+1)">Forward</a>
    [/QUOTE]


    as javascript is not supoposed to go in the href="" I'm sure you ment to write

    <a onclick="history.go(-1)">Back</a>

    and

    <a onclick="history.go(+1)">Forward</a>
    Copy linkTweet thisAlerts:
    @CharlesFeb 05.2003 — [font=monospace]<script type="text/javascript">

    <!--

    document.write('<p><a href="#">Get Back Jo-Jo</a> | <a href="#">Onward and Upward</a></p>');

    document.links[document.links.length-2].onclick = function () {[b]top[/b].history.back(); return false};

    document.links[document.links.length-1].onclick = function () {[b]top[/b].history.forward(); return false};

    // -->

    </script>[/font]
    ×

    Success!

    Help @Four_of_Five spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.22,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...