test
test

Reputation: 18198

window.location.hash does page reload?

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?

Upvotes: 2

Views: 1853

Answers (1)

Derek 朕會功夫
Derek 朕會功夫

Reputation: 94409

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.)

Upvotes: 2

Related Questions