Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] window location hash


  • From: glenn_lanier at netzero.net (Glenn E. Lanier, II)
  • Subject: [Javascript] window location hash
  • Date: Thu Mar 22 10:41:02 2007

	From: Guillaume
	Sent: Thursday, March 22, 2007 9:37 AM

	I'm experiencing a problem with:
	
	 window.location.hash = "bottomPage";
	
	It's buggy in Safari...
	
	The problem is known as the Safari location.hash reload bug and has
been documented by Mark "Tarquin" Wilton-Jones... Read below a cut and paste
describing the problem and the solution
(http://www.howtocreate.co.uk/safari/locationHashBug.html).
	...
	

	What is going on here?


	Setting location.hash to the same value twice in a row causes Safari
to reload the page. Tested in Safari 1.1-1.2 and equivalent OmniWeb
versions.


	What can be done to workaround this bug?


	Don't set location.href to the same value twice in a row. If needed,
set it to an intermediate value in between.

	...
	
	Anyone having an idea on how to apply this workaround to the code
mentioned before.
	

Untested, but would

var hashValue = "bottomPage";
if (hashValue != window.location.hash)
{
	window.location.hash = hashValue;
}

work?

--G