making a back button

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David

    making a back button

    Hi,

    I have a graphic with a rollover for site navigation on each page. I
    put the page to go back to in the rollover javascript.

    My question is, is it possible to put in some code that will refer the
    visitor back to whatever page they came from rather than one I
    specify?

    The rollover is combined with a tooltip script to make matters fun
    (below). However, I'm quite happy to lose the tooltip to have the link
    perform as a back button.

    Thanks

    David

    <a href="../index.asp"
    onmouseover="do cument.images['link1'].src=img2.src;
    showtip(this,ev ent,'Back to home page');"
    onmouseout="doc ument.images['link1'].src=img1.src; hidetip()";><im g
    src="bhome.gif" name="link1" border=0></a>
  • herders@yahoo.com

    #2
    Re: making a back button


    <a href="#" onclick="javscr ipt:history.go(-1);"
    onmouseover="do cument.images['link1'].src=img2.src;
    showtip(this,ev ent,'Back to home page');"
    onmouseout="doc ument.images['link1'].src=img1.src; hidetip()";><im g
    src="bhome.gif" name="link1" border="0" /></a>

    David wrote:
    [color=blue]
    > Hi,
    >
    > I have a graphic with a rollover for site navigation on each page. I
    > put the page to go back to in the rollover javascript.
    >
    > My question is, is it possible to put in some code that will refer the
    > visitor back to whatever page they came from rather than one I
    > specify?
    >
    > The rollover is combined with a tooltip script to make matters fun
    > (below). However, I'm quite happy to lose the tooltip to have the link
    > perform as a back button.
    >
    > Thanks
    >
    > David
    >
    > <a href="../index.asp"
    > onmouseover="do cument.images['link1'].src=img2.src;
    > showtip(this,ev ent,'Back to home page');"
    > onmouseout="doc ument.images['link1'].src=img1.src; hidetip()";><im g
    > src="bhome.gif" name="link1" border=0></a>[/color]

    Comment

    • David

      #3
      Re: making a back button

      Thanks - sorted!

      <herders@yahoo. com> wrote in message news:3F2C64D4.A 348C9A4@yahoo.c om...[color=blue]
      >
      > <a href="#" onclick="javscr ipt:history.go(-1);"
      > onmouseover="do cument.images['link1'].src=img2.src;
      > showtip(this,ev ent,'Back to home page');"
      > onmouseout="doc ument.images['link1'].src=img1.src; hidetip()";><im g
      > src="bhome.gif" name="link1" border="0" /></a>
      >
      > David wrote:
      >[color=green]
      > > Hi,
      > >
      > > I have a graphic with a rollover for site navigation on each page. I
      > > put the page to go back to in the rollover javascript.
      > >
      > > My question is, is it possible to put in some code that will refer the
      > > visitor back to whatever page they came from rather than one I
      > > specify?
      > >
      > > The rollover is combined with a tooltip script to make matters fun
      > > (below). However, I'm quite happy to lose the tooltip to have the link
      > > perform as a back button.
      > >
      > > Thanks
      > >
      > > David
      > >
      > > <a href="../index.asp"
      > > onmouseover="do cument.images['link1'].src=img2.src;
      > > showtip(this,ev ent,'Back to home page');"
      > > onmouseout="doc ument.images['link1'].src=img1.src; hidetip()";><im g
      > > src="bhome.gif" name="link1" border=0></a>[/color]
      >[/color]


      Comment

      • Evertjan.

        #4
        Re: making a back button

        wrote on 03 aug 2003 in comp.lang.javas cript:[color=blue][color=green]
        >> <a href="../index.asp"[/color]
        > <a href="#" onclick="javscr ipt:history.go(-1);"
        > onmouseover="do cument.images['link1'].src=img2.src;
        > showtip(this,ev ent,'Back to home page');"
        > onmouseout="doc ument.images['link1'].src=img1.src; hidetip()";><im g
        > src="bhome.gif" name="link1" border="0" /></a>[/color]

        why not:

        <a href="../index.asp" onclick="histor y.go(-1);">
        <img
        src="bhome.gif" border="0"
        onmouseover="th is.src=img2.src ;showtip(this,e vent,'Back to home page');"
        onmouseout="thi s.src=img1.src; hidetip();"
        />
        </a>

        - The href is only used if javascript is not available
        - mind the spelling of javascript
        - javascript is default in onclick
        - ";> is wrong, should be ;">
        - if img1.src is 'bhome.gif' why not generalize to:

        onmouseover="th is.old=this.src ;this.src=img2. src;
        showtip(this,ev ent,'Back to home page');"
        onmouseout="thi s.src=this.old; hidetip();"


        --
        Evertjan.
        The Netherlands.
        (Please change the x'es to dots in my emailaddress)

        Comment

        Working...