Connecting Tech Pros Worldwide Help | Site Map

history.go("URL") doesnt work

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 20th, 2005, 02:36 PM
Harald Weiser
Guest
 
Posts: n/a
Default 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="javascript:history.go('dosearch=0')">

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

Suggestions?

THX, Harry



  #2  
Old July 20th, 2005, 02:36 PM
Michael Winter
Guest
 
Posts: n/a
Default 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)
  #3  
Old July 20th, 2005, 02:37 PM
rgee_f
Guest
 
Posts: n/a
Default 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
  #4  
Old July 20th, 2005, 02:37 PM
Harald Weiser
Guest
 
Posts: n/a
Default 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


  #5  
Old July 20th, 2005, 02:37 PM
Evertjan.
Guest
 
Posts: n/a
Default 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)
  #6  
Old July 20th, 2005, 02:37 PM
Brian Genisio
Guest
 
Posts: n/a
Default 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

  #7  
Old July 20th, 2005, 02:38 PM
Randy Webb
Guest
 
Posts: n/a
Default 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/

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.