Back Button or Link

Discussion in 'Javascript' started by FluxForums, Feb 22, 2004.

  1. FluxForums

    FluxForums Guest

    FluxForums, Feb 22, 2004
    #1
    1. Advertising

  2. FluxForums <> wrote:
    ><a href="" onclick="history.go(-1); return false;">Your Image or Text
    >Link</a>


    Apart form the obvious failure to verify the existence of the history
    object and its - go - method in the execution environment of this
    script, a recurring (and unsolvable) problem with "back" button scripts
    is that they cannot know whether there is a history to go back into. If
    the page was opened in a new window or tab, accessed as a home page or
    from a desktop link then there is no preceding URL and the code cannot
    do anything.

    The browser knows these details and greys out the back button (and
    context menu entry) when there is no history. Attempting to reproduce
    normal browser behaviour with a script places a considerable onus on the
    script author to do as good a job as the browser would have. There is no
    point re-inventing a wheel if it is going to be square.

    Having realised that the control should be evidently disabled whenever
    there is no history to go back into, it should also be clear that the
    control should be evidently disabled or missing whenever the browser in
    use does not support scripting at all.

    <snip>
    >FluxForums's Profile: http://www.fluxforums.com/...

    <snip>

    As you appear to have some connection with this web site, you should
    maybe consider how wise it is to drop unsuspecting users of your site
    (potentially clients by the look of some of the other services offered)
    into Usenet newsgroups without even warning them where they are posting
    to. Usenet is not something that you can take advantage of without any
    consequences. The potential for generating negative publicity alone can
    be considerable. If you want to see how it works go to groups.google.com
    and search alt.html, alt,html.critique,
    comp.infosystems.www.authoring.stylesheets and comp.lang.javascript for
    "forum4designers" and see what potential troubles you are inviting.

    Richard.
     
    Richard Cornford, Feb 24, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Earl Teigrob
    Replies:
    0
    Views:
    568
    Earl Teigrob
    Dec 15, 2003
  2. sylvia sil
    Replies:
    1
    Views:
    625
    Curt_C [MVP]
    Dec 29, 2004
  3. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    882
    Kevin Spencer
    May 17, 2005
  4. Author
    Replies:
    6
    Views:
    3,104
    George
    Jan 22, 2009
  5. Useful Info

    Firefox back button takes me back 2 pages.

    Useful Info, Jun 3, 2007, in forum: Javascript
    Replies:
    0
    Views:
    347
    Useful Info
    Jun 3, 2007
Loading...

Share This Page