Firefox 在IE8/Chrome中单击后打开mailto

Firefox 在IE8/Chrome中单击后打开mailto,firefox,internet-explorer-8,window,mailto,Firefox,Internet Explorer 8,Window,Mailto,我目前正在尝试执行以下操作: 触发器:单击选择列表中的名称 操作:在当前窗口中打开mailto链接,从而打开电子邮件客户端 $(document).ready(function(){ // Define click-event $('option').click(function(){ var mail = $(this).attr('value'); window.open('mailto:'+mail, '_self'); }); }); 我还尝试使用此

我目前正在尝试执行以下操作:

触发器:单击选择列表中的名称

操作:在当前窗口中打开mailto链接,从而打开电子邮件客户端

$(document).ready(function(){    

// Define click-event
$('option').click(function(){
    var mail = $(this).attr('value');
    window.open('mailto:'+mail, '_self');
    });

});
我还尝试使用此选项而不是Windows。打开:

parent.location.href='mailto:'+mail

然而,这两种浏览器都只能在firefox中使用,在IE8或Chrome中不会出现错误/结果

有人知道问题出在哪里吗?

这个怎么样(在IE8上适用于我)

也许有更好的方法可以做到这一点,但我在我的一个页面上使用了类似的方法


如果电子邮件地址可以存储为select选项值,请在末尾使用.val()而不是.text()。

这几乎可以正常工作,必须将选项选择器更改为“select”,非常感谢:)Doh!是的,它应该是选择项的名称,而不是选项的名称。道歉:)另外,如果你用标签jQuery标记你的问题,你可能会因此得到更多的关注。。。
$('option').change(function() {
   var target = 'mailto:' + $('option:selected', this).text();
   window.location=target;
});