javascript 如何从弹出窗口中删除地址栏
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14830458/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to remove the address bar from a popup window
提问by Jitesh
onClick="window.open('index.php?option=com_virtuemart&page=shop.cart&product_id=<?php echo $product_id?
>&Itemid=18','mywindow','directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=350')"
回答by MrCode
Internet Explorer will always show the address bar, it isn't possible to remove it on a popup. Some browsers will hide the address bar with the location=no
flag, but IE doesn't.
Internet Explorer 将始终显示地址栏,无法在弹出窗口中将其删除。一些浏览器会隐藏带有location=no
标志的地址栏,但 IE 不会。
From MSDN:
从MSDN:
In Internet Explorer 7 and later, you cannot remove the address bar in Internet Zone windows, for security (anti-spoofing) reasons.
在 Internet Explorer 7 及更高版本中,出于安全(反欺骗)原因,您无法删除 Internet 区域窗口中的地址栏。
Popups should be avoided anyway, many visitors will have popup blocking software or the browser will simply block it. It would be better to consider something like a <div>
overlay on the page which you could code manually, or use a ready made plugin such as jQuery UI Dialog or Lightbox.
无论如何都应该避免弹出窗口,许多访问者会安装弹出窗口阻止软件,或者浏览器会简单地阻止它。最好考虑像<div>
页面上的叠加层,您可以手动编码,或者使用现成的插件,例如 jQuery UI Dialog 或 Lightbox。
回答by Surendra Pulukuri
To disable the address bar follow the steps below
要禁用地址栏,请按照以下步骤操作
1) Select Tools in IE7 2) Select Security Tab 3) Choose Internet Zone and click on Custom level 4) Scroll down till “Allow websites to open windows without address or status bars” 5) Select "Disable" -> OK 6) Restart IE7 and you are done.To disable the address bar follow the steps below
1) 在 IE7 中选择工具 2) 选择安全选项卡 3) 选择 Internet 区域并单击自定义级别 4) 向下滚动直到“允许网站打开没有地址或状态栏的窗口” 5) 选择“禁用”-> 确定 6) 重新启动IE7,你就大功告成了。要禁用地址栏,请按照以下步骤操作