history.go("URL") doesnt work

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

    history.go("URL") doesnt work

    Hi you out there.

    I use the following string to go back to a page that's in the history.
    <A HREF="javascrip t:history.go('d osearch=0')">

    But nothing happens. Using the complete URL makes no difference :-(

    Suggestions?

    THX, Harry


  • Michael Winter

    #2
    Re: history.go(&quo t;URL&quot;) doesnt work

    On Mon, 16 Feb 2004 13:30:00 +0100, wrote:
    [color=blue]
    > I use the following string to go back to a page that's in the history.
    > <A HREF="javascrip t:history.go('d osearch=0')">[/color]

    The method, History.go(), expects an integer, not a string.

    On a different matter, read:



    Mike

    --
    Michael Winter
    M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)

    Comment

    • rgee_f

      #3
      Re: history.go(&quo t;URL&quot;) doesnt work

      "Harald Weiser" <hawe@domea[remove].com> wrote in message news:<c0qd26$ia 5$1@paperboy.Au stria.EU.net>.. .[color=blue]
      > Hi you out there.
      >
      > I use the following string to go back to a page that's in the history.
      > <A HREF="javascrip t:history.go('d osearch=0')">
      >
      > But nothing happens. Using the complete URL makes no difference :-(
      >
      > Suggestions?
      >
      > THX, Harry[/color]


      Try this:

      <a href="javascrip t:history.go(-1)"> return to previous page</a>

      HTH

      Comment

      • Harald Weiser

        #4
        Re: history.go(&quo t;URL&quot;) doesnt work


        "rgee_f" <neprouto8w@jet able.org> schrieb im Newsbeitrag
        news:bc84d542.0 402161655.4d45d 5c2@posting.goo gle.com...[color=blue]
        > Try this:
        >
        > <a href="javascrip t:history.go(-1)"> return to previous page</a>
        >
        > HTH[/color]

        I know this one, but then I would have to remember how many pages a called
        since then... And I read that with go you can give a location as
        parameter...

        Harry


        Comment

        • Evertjan.

          #5
          Re: history.go(&quo t;URL&quot;) doesnt work

          Harald Weiser wrote on 17 feb 2004 in comp.lang.javas cript:
          [color=blue]
          >
          > "rgee_f" <neprouto8w@jet able.org> schrieb im Newsbeitrag
          > news:bc84d542.0 402161655.4d45d 5c2@posting.goo gle.com...[color=green]
          >> Try this:
          >>
          >> <a href="javascrip t:history.go(-1)"> return to previous page</a>
          >>
          >> HTH[/color]
          >
          > I know this one, but then I would have to remember how many pages a
          > called since then... And I read that with go you can give a location
          > as parameter...[/color]

          No,

          use this:

          <a href="javascrip t:location.href =URL">
          return to specified previous page</a>


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

          Comment

          • Brian Genisio

            #6
            Re: history.go(&quo t;URL&quot;) doesnt work

            Harald Weiser wrote:

            [color=blue]
            > I know this one, but then I would have to remember how many pages a called
            > since then... And I read that with go you can give a location as
            > parameter...[/color]

            My refrerence says the same thing (JavaScript Bible by Danny Goodman):

            go(relativeNumb er | "URLOrTitleSubs tring")

            Which tells me that _some_ browsers will support a URL or Title
            substring, IF AND ONLY IF the value exists in the history already.

            The IE reference says the following about the parameter:

            "[The parameter] specifies an integer or a string. An integer indicates
            the relative position of a URL in the History list. A string indicates
            an exact URL in the History list."

            This is different than saying
            [document|window].location.href= "newPlace", because it effects the
            history differently.

            Still, the value must exist in the history (not the cache), meaning you
            must be able to navigate to it via forward and back. Note that there is
            some security in the history model... you cannot see what is in it... to
            avoid prying eyes from watching your every move :)

            Brian

            Comment

            • Randy Webb

              #7
              Re: history.go(&quo t;URL&quot;) doesnt work

              Evertjan. wrote:[color=blue]
              > Harald Weiser wrote on 17 feb 2004 in comp.lang.javas cript:
              >
              >[color=green]
              >>"rgee_f" <neprouto8w@jet able.org> schrieb im Newsbeitrag
              >>news:bc84d542 .0402161655.4d4 5d5c2@posting.g oogle.com...
              >>[color=darkred]
              >>>Try this:
              >>>
              >>><a href="javascrip t:history.go(-1)"> return to previous page</a>
              >>>
              >>>HTH[/color]
              >>
              >>I know this one, but then I would have to remember how many pages a
              >>called since then... And I read that with go you can give a location
              >>as parameter...[/color]
              >
              >
              > No,
              >
              > use this:
              >
              > <a href="javascrip t:location.href =URL">
              > return to specified previous page</a>
              >
              >[/color]

              <a href="howToUseT heBackButton.ht ml" onclick="locati on.href=URL">
              return to specified previous page</a>



              --
              Randy
              Chance Favors The Prepared Mind
              comp.lang.javas cript FAQ - http://jibbering.com/faq/

              Comment

              Working...