views:

117

answers:

1

I have an anchor <a href="#!admin">General</a> somewhere in my page. Clicking this in any browser but IE7 (haven't tried IE6) causes no page reload, as expected. However, under IE7 it reloads the page as soon as it's clicked. The strangest thing is that I have the exact same anchor elsewhere in the page and it causes no reload. The only difference I can see between these is a slight difference in style, and the fact that the faulty anchor is deeply nested in divs, where the other is closer to the top.

My questions:

  • Is this a known bug with IE7?
  • If so, is there any work around?
  • If not, any clue as to what might be going wrong?

Edit:

If you want to see this yourself, go to http://filouguestbook.appspot.com/#!main sign-in with a google account and click on the Settings link in the the top bar. Switch between the General and Accounts pages, the app will reload. From the Accounts page, click on Settings in the top bar, this will switch tab but not reload!

A: 

I've had a similar issue, it seems if there is no '#' in the location already, adding it dynamically will cause IE to reload the page. If there is already a '#' in the current location, you can change / append to the fragment without a refresh.

So you could make sure all links to that page end with a #, and/or onload add the # if it doesn't already exist (which will cause the page to double refresh once when it's loaded).

Rob
@Rob: That isn't the case and never has been. You can test so by scrolling up and adding your post number to the hash in the address bar for this page: `#2472320`
Andy E
I just had this exact issue with IE a couple of weeks ago, and that was the fix. Perhaps that was not IE's fault and was caused by something else in the page, can't test right now...
Rob