打开javascript弹出窗口,没有地址栏和标题,高度和宽度根据屏幕分辨率设置为百分比

我想使用没有标题和地址栏的javascript打开弹出窗口,并且还想根据屏幕分辨率设置其高度和宽度百分比。我怎样才能实现这一点。 我做了这个代码;

function popitup(url) { LeftPosition = (screen.width) ? (screen.width - 800) / 2 : 0; TopPosition = (screen.height) ? (screen.height - 700) / 2 : 0; var sheight = (screen.height) * 0.9; var swidth = (screen.width) * 0.8; settings = 'height='+ sheight + ',width='+ swidth + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=yes,resizable=yes,toolbar=no,status=no,menu=no, directories=no,titlebar=no,location=no,addressbar=no' newwindow = window.open(url, '', settings); if (window.focus) { newwindow.focus() } return false; } 

但我仍然可以看到地址和标题栏。这是相对版本和浏览器类型吗?。如果是这样我怎样才能在最新版本的浏览器中实现这些设置,如IE9,Chrome,Firefox和Safari?

出于安全原因,这是不可能的。

查看http://www.codeproject.com/Questions/79625/How-to-hide-title-bar-in-Javascript-popup

您可以使用更具吸引力的modal dialog等替代方案。 大多数JS库提供开箱即用的modal dialog或使用插件。

它应该是menu = no还是menubar = no ??

settings = 'width='+w+',height='+h+',top='+top+', left='+left+',menubar=no,resizable=no,scrollbars=yes,location=no,toolbar=no'对我来说很好。