简体   繁体   English

为什么JavaScript无法在Firefox中运行?

[英]Why doesn't this JavaScript run in Firefox?

It certainly runs on IE6. 它当然可以在IE6上运行。

Why doesn't this JavaScript run in Mozilla Firefox? 为什么此JavaScript无法在Mozilla Firefox中运行?

<html>
<head>
 <title>JavaScript Popup Example 3</title>
</head>
<SCRIPT language="JavaScript1.2">
function MyClass()
{
    this.OpenWindow = function()
    {
        var r = window.open ('', 'mywindow', 'location=1,status=1,scrollbars=1,width=100,height=100');
        r.moveTo(0,0);
        r.location.href = 'http://www.google.com';
    }

}
</SCRIPT>
<body onload="javascript: new MyClass().OpenWindow()">
<H1>JavaScript Popup Example 3</H1>
</body>
</html>

It runs just fine in my FF. 它在我的FF中运行得很好。 For me the popup blocker is catching it. 对我来说,弹出窗口阻止程序正在捕获它。

Did you notice that little bar just below the tabs selection 您是否注意到选项卡选择下方的小条

alt text http://support.mozilla.com/img/wiki_up/86c0e1094489ddd5611008de57d0afed-1249166734-294-5.png 替代文字http://support.mozilla.com/img/wiki_up/86c0e1094489ddd5611008de57d0afed-1249166734-294-5.png

Check here for more information + images: FF Pop-up blocker 在此处查看更多信息和图像: FF弹出窗口阻止程序

弹出阻止程序设置

Just go to the FF menu -> option -> content -> block-pop-up-windows 只需转到FF菜单->选项->内容->块弹出窗口

Uncheck the option, click OK and try reload the page. 取消选中该选项,单击“ 确定” ,然后尝试重新加载页面。 It should now work fine for you. 现在,它应该可以正常工作。 Also, don't forget to tick the check box again if you worry about security. 另外,如果您担心安全性,也不要忘记再次选中该复选框。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM