Javascript onclick 仅适用于 chrome,不适用于 firefox 或 IE
Javascript onclick only works in chrome, not in firefox or IE
请有人帮忙。
我在我们的网站上实现了一些社交媒体按钮,它们在 Chrome 中运行良好,但发现在 Firefox 或 IE 中不起作用。
网址是www.m-j-p.co.uk。当使用 IE 或 firefox 时,每个按钮都会从站点导航到空白屏幕,其中一些会在地址栏中显示功能名称。
尝试了 firefox 控制台,但没有给出任何错误或线索。
<script language="javascript">
function tweetCurrentPage()
{window.open("https://twitter.com/share?url="+escape(window.location.href)+"&text="+document.title, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');return false; }
</script>
<script language="javascript">
function twitFollow()
{window.open("https://twitter.com/intent/follow?screen_name=MedNeg", '', 'menubar=no,toolbar=no,resizable=no,scrollbars=yes,height=580,width=380');return false; }
</script>
<li class="but50"><a style="padding-bottom: 18px;" href="javascript:tweetCurrentPage()" target="_blank" alt="Tweet this page" data-via="medneg"><div style="width:50px; text-align:center; float:left"><i class='fa fa-twitter icon' style="font-size: 28px;"></i></div> Share Page</a></li>
<li class="but50"><a style="padding-bottom: 18px;" href="javascript:twitFollow()"><div style="width:50px; text-align:center; float:left"><i class='fa fa-twitter icon' style="font-size: 28px;"></i></div> Follow @MJP</a></li>
<li class="but50"><a style="padding-bottom: 18px;" href="javascript:void(0)" onclick="tweetCurrentPage()" target="_blank" alt="Tweet this page" data-via="medneg"><div style="width:50px; text-align:center; float:left"><i class='fa fa-twitter icon' style="font-size: 28px;"></i></div> Share Page</a></li>
<li class="but50"><a style="padding-bottom: 18px;" href="javascript:void(0)" onclick="twitFollow()"><div style="width:50px; text-align:center; float:left"><i class='fa fa-twitter icon' style="font-size: 28px;"></i></div> Follow @MJP</a></li>
运行 像这样点击一次
<a href="#" onclick="tweetCurrentPage(); return false" style="display:block; float:right; height:40px; width:100px; cursor:pointer; text-decoration:none">test<a>
请有人帮忙。
我在我们的网站上实现了一些社交媒体按钮,它们在 Chrome 中运行良好,但发现在 Firefox 或 IE 中不起作用。
网址是www.m-j-p.co.uk。当使用 IE 或 firefox 时,每个按钮都会从站点导航到空白屏幕,其中一些会在地址栏中显示功能名称。
尝试了 firefox 控制台,但没有给出任何错误或线索。
<script language="javascript">
function tweetCurrentPage()
{window.open("https://twitter.com/share?url="+escape(window.location.href)+"&text="+document.title, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');return false; }
</script>
<script language="javascript">
function twitFollow()
{window.open("https://twitter.com/intent/follow?screen_name=MedNeg", '', 'menubar=no,toolbar=no,resizable=no,scrollbars=yes,height=580,width=380');return false; }
</script>
<li class="but50"><a style="padding-bottom: 18px;" href="javascript:tweetCurrentPage()" target="_blank" alt="Tweet this page" data-via="medneg"><div style="width:50px; text-align:center; float:left"><i class='fa fa-twitter icon' style="font-size: 28px;"></i></div> Share Page</a></li>
<li class="but50"><a style="padding-bottom: 18px;" href="javascript:twitFollow()"><div style="width:50px; text-align:center; float:left"><i class='fa fa-twitter icon' style="font-size: 28px;"></i></div> Follow @MJP</a></li>
<li class="but50"><a style="padding-bottom: 18px;" href="javascript:void(0)" onclick="tweetCurrentPage()" target="_blank" alt="Tweet this page" data-via="medneg"><div style="width:50px; text-align:center; float:left"><i class='fa fa-twitter icon' style="font-size: 28px;"></i></div> Share Page</a></li>
<li class="but50"><a style="padding-bottom: 18px;" href="javascript:void(0)" onclick="twitFollow()"><div style="width:50px; text-align:center; float:left"><i class='fa fa-twitter icon' style="font-size: 28px;"></i></div> Follow @MJP</a></li>
运行 像这样点击一次
<a href="#" onclick="tweetCurrentPage(); return false" style="display:block; float:right; height:40px; width:100px; cursor:pointer; text-decoration:none">test<a>