views:

849

answers:

3

For some reason, in IE (IE8 in Win 7 to be precise), when I click on a mailto link, I end up with the current page being replaced by a blank page with mailto in the address bar.

Specifically, this is what happens when I click the mailto link:

  1. New about:blank tab opens and a security prompt pops up asking if I want to open Outlook. At this point, it looks like the original tab still is showing the original page.
  2. When I click "Allow" or "Don't Allow", the new tab closes and the original page is reloaded with the mailto in the address bar.

If I comment out the dojo.xd.js reference, it works as expected.

Firefox and Chrome just pop up the Outlook new message window. Also tested and works on Windows XP and IE7.

The code to replicate the issue is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd"&gt;
        <HTML>
         <HEAD>
          <TITLE>mailto test</TITLE>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.3.2/dojo/dojo.xd.js" djConfig="parseOnLoad: true"></script>
         </HEAD>
         <BODY>
          <a href="mailto:[email protected]">mailto</a>
         </BODY>
        </HTML>
A: 

Your doctype isn't complete... change it to this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd"&gt;
scunliffe
I just left the doctype which the editor put there... changed it to what you suggested, but it doesn't fix the problem.
Eugene Katz
A: 

If you create a hidden iframe with a name="foo" attribute, then put a target="foo" on the a tag for the link it should avoid the problem.

jrburke
no, couldn't get that to work. It seems to be setting the URL of the top.
Eugene Katz
A: 
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
no, that doesn't fix it.
Eugene Katz