2

OK so whenever I want to change my URL with hash, I do this:

window.location.hash = 'something';

But I have a question. Is it just me or does the page load again?

test
  • 17,706
  • 64
  • 171
  • 244
  • 3
    The page shouldn't reload. What browser/version are you using? – Will Dec 11 '11 at 20:33
  • possible duplicate of [javascript location.hash refreshing in IE](http://stackoverflow.com/questions/2602260/javascript-location-hash-refreshing-in-ie) – Chris J Dec 11 '11 at 20:40

1 Answers1

2

It should not reload, and if it does reload, then you might be using IE.

It appears to be a bug in IE and you might want to try this:

window.location.hash = 'id';

This works on IE7. (Tried on IE9 using IE7 standard.)

Community
  • 1
  • 1
Derek 朕會功夫
  • 92,235
  • 44
  • 185
  • 247