How to disable location bar and scroll bars of pop window in Chrome?

﹥>﹥吖頭↗ 提交于 2019-12-06 02:16:09

问题


For the following code width and height are working in Chrome but location and scrollbar are not working. Please guide.

<script language="JavaScript"> 
  function newwindow() { 
    window.open('http://localhost/a.php', 'jav',
        'width=300,height=200,resizable=yes,location=no,scrollbars=no'); 
  } 
</script>

<a href="javascript:newwindow()">Click Here</a>

回答1:


Chrome will not allow you to do this for security reasons. Hiding the address bar makes it easier to pretend you're somebank.com when really you're somenigerianguy.com.

As for the scrollbar, you can use css on a.php to hide the scrollbars by setting overflow: hidden.




回答2:


To hide the scrollbar: try setting "overflow: hidden;" in the css

You can't open a popup without location bar like in IE, to workaround this you could use an iframe or some third party jQuery plugin



来源:https://stackoverflow.com/questions/6748246/how-to-disable-location-bar-and-scroll-bars-of-pop-window-in-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!