Visit stackoverflow.com/#_=_
and window.location.hash
evaluates to #_=_
. Fine.
Now execute window.location.hash = \'\'>
There are 2 things driving this behaviour:
So basically, setting the hash property should never lead to a reload, setting any other property should lead to a reload (or perhaps an E-Tag/modified-since header check, depending on browser settings).
I would assume that for the sake of consistency, browser builders transform setting an empty hash, to setting '#' as hash. This way the url in the location bar does not lead to a reload. But this latter part is pure speculation.