开发者

mailto link in internet explorer navigates to dead end

开发者 https://www.devze.com 2022-12-20 04:20 出处:网络
I am using an anchor with mailto, and I am finding that the behavior is extremely unrefined. <a id=\"Help\" href=\"mailto:abc_123@domain.com\">Questions</a>

I am using an anchor with mailto, and I am finding that the behavior is extremely unrefined.

<a id="Help" href="mailto:abc_123@domain.com">Questions</a>

when I do this in IE8, I find that in some locations, the windows asks if it can open outlook, you say yes, and it opens a new email message and sets the To: section. It also leaves the browser window in the same site that I came from.

When I do this in my implementation with the above 开发者_Python百科link, I find that the browser navigates to mailto:abc_123@domain.com, and shows an ugly: Internet Explorer cannot display the webpage error. What do I need to do to make this work nicely, like the above case? Finally, it fails to leave the browser in the original location that I came from.

Edit: I just noticed that the badly behaving version is local host and the good behaving version is on a production server. Could that make a difference?


I notice you've tagged this with jQuery. Is it possible that there is an event handler being added to the link which does something like this:

$('a').click(function() {
    window.location.href = this.href;
    return false;
});


Part of the problem appears to be that IE has problems with long mailto links.

mailto fails in IE where there is a long body text. Is there any way to resolve this?

Keep your links less than 512 characters, and you should see fewer problems when using IE.


This is completely in your browser.

Go into Folder Options (Control Panel), File Types, and see what handler is associated with the URL:Mailto protocol. You'll have to click on Advanced and edit the 'open' action to see what is the handler/server for that filetype association.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号