简体   繁体   English

如何隐藏模式对话框中的地址栏?

[英]How can I hide the address bar in a modal dialog?

How can I hide the address bar (location bar ) in a modal dialog? 如何在模式对话框中隐藏地址栏(位置栏)? Here is my code: 这是我的代码:

var dialogFeatures = 'center:yes; dialogWidth:600px; location:no;dialogHeight:400px; edge:raised; help:no; resizable:no; scroll:no; status:no; statusbar:no; toolbar:no; menubar:no; addressbar:no; titlebar:no;';
newwindow2 = window.showModalDialog('Combo?start1=' + calEvent.start + '&end1=' + calEvent.end + '&ownerType=' + < %= ApplicationConstants.OWNER_TYPE_CALENDAR % > , 'app', dialogFeatures);

It's not possible. 这是不可能的。 The address bar is a security feature in most browsers, in IE since version 7, in Firefox (I think) since version 2. 在大多数浏览器中,地址栏是一项安全功能,从版本7开始,在IE中,从版本2开始,在Firefox(我认为)中。

You can't hide the address bar, location: no is not a valid option for the features argument. 您无法隐藏地址栏的location: no不是features参数的有效选项。

In Internet Explorer 7 and later, all windows opened by the browser have an address bar. 在Internet Explorer 7和更高版本中,浏览器打开的所有窗口都具有一个地址栏。 The same is true of Google Chrome and other browsers supporting showModalDialog . Google Chrome和其他支持showModalDialog浏览器也是如此。

You can't. 你不能

Hiding the address bar is disallowed in most browsers, for security reasons. 出于安全原因,在大多数浏览器中都不允许隐藏地址栏。

in about:config change this parameter: 在about:config中更改此参数:

dom.disable_window_open_feature.location dom.disable_window_open_feature.location
and for menubar and any other components you have to change their feature in about:config 对于菜单栏和任何其他组件,您必须在about:config中更改其功能

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

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