Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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>
like image 809
umar Avatar asked Jul 19 '11 13:07

umar


Video Answer


2 Answers

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.

like image 139
James Montagne Avatar answered Oct 16 '22 12:10

James Montagne


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

like image 27
BALKANGraph Avatar answered Oct 16 '22 11:10

BALKANGraph