Connecting Tech Pros Worldwide Help | Site Map

history.go("URL") doesnt work

Harald Weiser
Guest
 
Posts: n/a
#1: Jul 20 '05
Hi you out there.

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

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

Suggestions?

THX, Harry


Michael Winter
Guest
 
Posts: n/a
#2: Jul 20 '05

re: history.go("URL") 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="javascript:history.go('dosearch=0')">[/color]

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

On a different matter, read:

http://www.jibbering.com/faq/#FAQ4_24

Mike

--
Michael Winter
M.Winter@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
rgee_f
Guest
 
Posts: n/a
#3: Jul 20 '05

re: history.go("URL") doesnt work


"Harald Weiser" <hawe@domea[remove].com> wrote in message news:<c0qd26$ia5$1@paperboy.Austria.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="javascript:history.go('dosearch=0')">
>
> But nothing happens. Using the complete URL makes no difference :-(
>
> Suggestions?
>
> THX, Harry[/color]


Try this:

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

HTH
Harald Weiser
Guest
 
Posts: n/a
#4: Jul 20 '05

re: history.go("URL") doesnt work



"rgee_f" <neprouto8w@jetable.org> schrieb im Newsbeitrag
news:bc84d542.0402161655.4d45d5c2@posting.google.c om...[color=blue]
> Try this:
>
> <a href="javascript: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


Evertjan.
Guest
 
Posts: n/a
#5: Jul 20 '05

re: history.go("URL") doesnt work


Harald Weiser wrote on 17 feb 2004 in comp.lang.javascript:
[color=blue]
>
> "rgee_f" <neprouto8w@jetable.org> schrieb im Newsbeitrag
> news:bc84d542.0402161655.4d45d5c2@posting.google.c om...[color=green]
>> Try this:
>>
>> <a href="javascript: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="javascript:location.href=URL">
return to specified previous page</a>


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Brian Genisio
Guest
 
Posts: n/a
#6: Jul 20 '05

re: history.go("URL") 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(relativeNumber | "URLOrTitleSubstring")

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

Randy Webb
Guest
 
Posts: n/a
#7: Jul 20 '05

re: history.go("URL") doesnt work


Evertjan. wrote:[color=blue]
> Harald Weiser wrote on 17 feb 2004 in comp.lang.javascript:
>
>[color=green]
>>"rgee_f" <neprouto8w@jetable.org> schrieb im Newsbeitrag
>>news:bc84d542.0402161655.4d45d5c2@posting.google .com...
>>[color=darkred]
>>>Try this:
>>>
>>><a href="javascript: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="javascript:location.href=URL">
> return to specified previous page</a>
>
>[/color]

<a href="howToUseTheBackButton.html" onclick="location.href=URL">
return to specified previous page</a>



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

Closed Thread