Connecting Tech Pros Worldwide Forums | Help | Site Map

Update location.hash without adding to history?

Mikey C
Guest
 
Posts: n/a
#1: Nov 21 '08
Hi Everyone,

I understand in many cases, adding to history when updating
window.location.hash is a GOOD thing. In my case, I want to update
bookmarkability from javascript (post-load), but can't get it to do so
without adding a record to history. (Firefox 3.0.3)

I know it's possible to do, because Google is doing it. See this
URL:
http://books.google.com/books?hl=en&...e7_NU#PPA21,M1

Note, scrolling up and down changes the hash without adding history
entries.

Any idea how this is done? I have been looking for a solution for
months (on and off, but haven't found anything.)

Thanks,
-MIke C

David Mark
Guest
 
Posts: n/a
#2: Nov 21 '08

re: Update location.hash without adding to history?


On Nov 20, 9:48*pm, Mikey C <mebemik...@gmail.comwrote:
Quote:
Hi Everyone,
>
I understand in many cases, adding to history when updating
window.location.hash is a GOOD thing. *In my case, I want to update
bookmarkability from javascript (post-load), but can't get it to do so
without adding a record to history. *(Firefox 3.0.3)
That would be a silly thing to do.
Quote:
>
I know it's possible to do, because Google is doing it. *See this
There is confirmation.
Quote:
URL:http://books.google.com/books?hl=en&...&oi=fnd&pg=PP1...
>
Note, scrolling up and down changes the hash without adding history
entries.
That is not what the hash is for and there is little chance that
Google is doing anything right in their script.
Quote:
>
Any idea how this is done? *I have been looking for a solution for
months (on and off, but haven't found anything.)
>
You wasted those months. Now re-think your design.
Thomas 'PointedEars' Lahn
Guest
 
Posts: n/a
#3: Nov 21 '08

re: Update location.hash without adding to history?


Mikey C wrote:
Quote:
I understand in many cases, adding to history when updating
window.location.hash is a GOOD thing. In my case, I want to update
bookmarkability from javascript (post-load), but can't get it to do so
without adding a record to history. (Firefox 3.0.3)
>
I know it's possible to do, because Google is doing it. See this
URL:
http://books.google.com/books?hl=en&...e7_NU#PPA21,M1
>
Note, scrolling up and down changes the hash without adding history
entries.
>
Any idea how this is done? I have been looking for a solution for
months (on and off, but haven't found anything.)
Well, the *location* is being *replace*d ...


HTH

PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Mikey C
Guest
 
Posts: n/a
#4: Nov 21 '08

re: Update location.hash without adding to history?


Thanks so much! Seems pretty darn simple now, but this is huge for
me.

I had been setting window.location.hash = "value".
window.location.replace("value") works!

Thanks again!,
-Mike C


On Nov 21, 2:58*pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
Quote:
Mikey C wrote:
Quote:
I understand in many cases, adding to history when updating
window.location.hashis a GOOD thing. *In my case, I want toupdate
bookmarkability from javascript (post-load), but can't get it to do so
without adding a record to history. *(Firefox 3.0.3)
>
Quote:
I know it's possible to do, because Google is doing it. *See this
URL:
http://books.google.com/books?hl=en&...&oi=fnd&pg=PP1...
>
Quote:
Note, scrolling up and down changes thehashwithout adding history
entries.
>
Quote:
Any idea how this is done? *I have been looking for a solution for
months (on and off, but haven't found anything.)
>
Well, the *location* is being *replace*d ...
>
HTH
>
PointedEars
--
* * realism: * *HTML 4.01 Strict
* * evangelism: XHTML 1.0 Strict
* * madness: * *XHTML 1.1 as application/xhtml+xml
* * * * * * * * * * * * * * * * * * * * * * * * * * -- Bjoern Hoehrmann
David Mark
Guest
 
Posts: n/a
#5: Nov 22 '08

re: Update location.hash without adding to history?


On Nov 21, 5:07*pm, Mikey C <mebemik...@gmail.comwrote:
Quote:
Thanks so much! *Seems pretty darn simple now, but this is huge for
me.
Still a silly idea, regardless of the perceived simplicity.
Closed Thread


Similar JavaScript / Ajax / DHTML bytes