0

In my site layout, we have the standard company logo image in the upper left hand corner that links back to the home page. The html is simple -

<a href="/">
  <img src="/Images/imageName.png" alt="Company Home" height="" width="" />
</a>

Hovering over the image shows the URL, and it works as expected in all browsers except IE 9. When clicking the image in IE 9, instead of linking to the home page it links to the image itself.

The developer tools say Browser Mode: IE 9, Document Mode: IE9 standards. The doctype being used is XHTML transitional (I'm not going to be able to switch the doctype). Switching the Document Mode in the dev tools to IE8 Standards fixes the issue. This appears to only affect IE 9.

Has anyone run into this before? I've tried hard coding a fully qualified or different url (http://www.google.com) and still get the image on click.

3
  • I can't reproduce this. What's the URL of your test page? Are you sure you aren't just reloading a cached (older) version of the page?
    – EricLaw
    Jul 11, 2011 at 17:59
  • Eric, do you have a junkmail address I can send a URL to? I'm not going to be able to post it here.
    – mld
    Jul 11, 2011 at 19:09
  • Please send it to me @microsoft.com.
    – EricLaw
    Jul 12, 2011 at 3:42

1 Answer 1

1

After some additional digging, it turns out that the issue was actually buried in some javascript from one of our analytics vendors.

A combination of IE 9 making addEventListener() available and an anchor tag's pathname property returning "" in IE and "/" in other browsers caused some logic to fail in IE 9 that was skipped over in other versions.

Eric Lawrence has a blog post about the pathname issue -

http://blogs.msdn.com/b/ieinternals/archive/2011/02/28/internet-explorer-window-location-pathname-missing-slash-and-host-has-port.aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.