在 Firefox 和 Firefox 中打开没有地址栏的新弹出窗口IE
希望有人可以帮忙。只是无法在没有地址栏的 Firefox 中打开新窗口。 以下代码一起正常工作
window.open('/pageaddress.html', 'winname',
directories=0,titlebar=0,toolbar=0,location=0,status=0,
menubar=0,scrollbars=no,resizable=no,
width=400,height=350);
IE可以与我需要为所有浏览器制作的
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
Firefox 3.0 及更高版本默认禁用设置
location
。默认情况下,ressized
和status
也处于禁用状态。您可以通过在地址栏中输入“about:config”并按“dom”进行过滤来验证这一点。感兴趣的项目有:您可以在 Mozilla 开发者网站。不过,这基本上意味着您将无法做您想做的事。
您可能想做的一件事(尽管它不能解决您的问题)是在窗口功能参数周围加上引号,如下所示:
Firefox 3.0 and higher have disabled setting
location
by default.resizable
andstatus
are also disabled by default. You can verify this by typing `about:config' in your address bar and filtering by "dom". The items of interest are:You can get further information at the Mozilla Developer site. What this basically means, though, is that you won't be able to do what you want to do.
One thing you might want to do (though it won't solve your problem), is put quotes around your window feature parameters, like so:
我同意我们不能在现代浏览器中隐藏地址栏,但我们可以隐藏地址栏中的URL(例如显示URL
about:blank
)。以下是我的解决方案:I agree we can not hide address bar in modern browsers, but we can hide the URL in address bar (e.g show URL
about:blank
). The following is my work around solution:查看有关 window.open 的 Mozilla 文档。
窗口功能(“directory=...,...,height=350”)等参数应该是一个字符串:
尝试一下是否在您的浏览器中有效。请注意,某些功能可能会被用户首选项覆盖,例如“位置”(请参阅文档)。
Check the mozilla documentation on window.open.
The window features ("directory=...,...,height=350") etc. arguments should be a string:
Try if that works in your browsers. Note that some of the features might be overridden by user preferences, such as "location" (see doc.)
解决方法 - 打开模式弹出窗口并将外部 URL 作为 iframe 嵌入。
Workaround - Open a modal popup window and embed the external URL as an iframe.
在 Internet Explorer 中,如果新 url 与当前 url 来自同一域,则打开的窗口将不显示地址栏。否则,会导致出现地址栏。一种解决方法是打开来自同一域的页面,然后从该页面重定向。
In internet explorer, if the new url is from the same domain as the current url, the window will be open without an address bar. Otherwise, it will cause an address bar to appear. One workaround is to open a page from the same domain and then redirect from that page.
检查这个是否有效,对我来说效果很好
check this if it works it works fine for me