为什么这些共享按钮在 Firefox 中不起作用?

Why do these share buttons not work in a Firefox?

我有一组共享按钮可以在 Safari、Chrome 和 Opera 中使用,但不能在 Firefox 中使用。他们只是在 Firefox 中打开一个新的空白 window 为什么会这样?

<script type="text/javascript">
function fbCurrentPage()
{window.open("https://www.facebook.com/sharer/sharer.php?u="+escape(window.location.href)+"&t="+document.title, '', 
'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');}
function twitterCurrentPage()
{window.open("https://twitter.com/share?u="+escape(window.location.href)+"&t="+document.title, '', 
'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');}
function gplusCurrentPage()
{window.open("https://plus.google.com/share?url="+escape(window.location.href)+"&t="+document.title, '', 
'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=605,width=400');}
</script>

<div class="social">
<a href="javascript:fbCurrentPage()" class="facebook">Facebook</a>
<a href="javascript:twitterCurrentPage()" class="twitter">Twitter</a>
<a href="javascript:gplusCurrentPage()" class="gplus">Google+</a>
</div> 

Firefox 对 target="_blank" 属性感到困惑。 Firefox 使用 about:blank URL 打开新选项卡并尝试执行其中一项功能,例如fbCurrentPage 在新打开的选项卡中,但该函数在 "blank" 文档中不存在。

只需从链接中删除 target 属性。不需要它,因为函数使用 window.open 打开一个新的 window.

另外,您的代码在 HTML 5 规范方面无效。您在链接中有按钮。 a 个元素,每个 spec are not allowed to contain interactive content