window.open()不能在Firefox 3锚打得好
-
20-09-2019 - |
题
下面的JavaScript,意在打开一个新的窗口的 和 强>跳跃到指定的锚,在IE工作很大。不幸的是,在Firefox中,它打开的窗口,但它不会跳至锚点。
我一直在努力,现在这个问题进行了两天(搜索和修改)无济于事。
如果任何人有任何见解,我怎么能得到这个像预期的那样在工作既IE 和的 Mozilla浏览器,我会永远感激。
下面是含有window.open()和该链接调用含有window.open()的函数的javascript函数:
<html>
<head>
<script language=javascript>
function openPopupWindow_Why(sPopupUrl, sPopupLabel)
{
window.open(sPopupUrl, sPopupLabel, 'toolbar=no,resizable=yes,
scrollbars=yes,height=250,width=450', false);
return false;
}
</script>
</head>
<body>
<A onclick="openPopupWindow_Why('MyProfile_WhyAsk.htm#ethnicity', 'Why')"
href="javascript:void(0)" class="WhyAsk">Why do we ask?</a>
</body>
</html>
下面是一个的通过打开页面上的HTML锚window.open():
<tr>
<td align="center">
<a name="#ethnicity"> </a>
</td>
</tr>
解决方案
尝试从种族锚名称去除#像这样:
<tr>
<td align="center">
<a name="ethnicity"> </a>
</td>
</tr>
作品中至少IE,火狐和Chrome
不隶属于 StackOverflow