Take the 2-minute tour ×

I have this code,

$('.editLayout #changeLayout').click(function() {
       data: {
           mainLayout: true
       success: function() {
          window.location = window.location.href;
return false;

When the alert returns I get a valid url with a hash an example being,


But the page does not refresh, if I hit f5 though the page refreshes as normal.

Any ideas?

share|improve this question

3 Answers 3

up vote 3 down vote accepted



UPDATED (And here hacky solution for chrome)

share|improve this answer
Doesn't seem to work, what could be causing this, before it was working but there was no hash tag. –  cgwebprojects Apr 1 '12 at 20:24
Which browser you trying ? Chrome ? –  safarov Apr 1 '12 at 20:25
Ye chrome, I test in chrome first then others –  cgwebprojects Apr 1 '12 at 20:26
Thanks worked brilliantly didn't expect chrome to have any bugs flying about it is normally up to date with everything! –  cgwebprojects Apr 1 '12 at 20:37

Updating a hash wont reload the page, and by the same token setting the page href to a href that contains a hash wont refresh it either. Try this:

window.location = window.location.href.split('#')[0];
share|improve this answer


window.location.href = window.location.href;
share|improve this answer

Your Answer


