Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Apr 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    I can't get window.open to get rid of address bar.

    I have the following code:
    var strAttribs = 'location=0,width=500,height=500,fullscreen=0,toolbar=0,status=0,menubar=0,titlebar=0,scrollbars=1,c opyhistory=0,resizable=0';

    var mywin = window.open("vidseg.aspx?helpstr=" + sPage, 'HelpWindow', strAttribs);
    mywin.moveTo(60, 60);
    The window does open, but it has an address bar, with a url shown in it. I thought "location=0" would get rid of that, but it did not.
    Any help is appreciated.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,314
    Thanks
    203
    Thanked 2,564 Times in 2,542 Posts
    Quote Originally Posted by GIDMEISTER View Post
    I have the following code:
    var strAttribs = 'location=0,width=500,height=500,fullscreen=0,toolbar=0,status=0,menubar=0,titlebar=0,scrollbars=1,c opyhistory=0,resizable=0';

    var mywin = window.open("vidseg.aspx?helpstr=" + sPage, 'HelpWindow', strAttribs);
    mywin.moveTo(60, 60);
    The window does open, but it has an address bar, with a url shown in it. I thought "location=0" would get rid of that, but it did not.
    Any help is appreciated.
    That is a security measure. You cannot suppress the address bar.

    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Those browsers that will allow you to get rid of the address bar so that a new address cannot be entered will generally display the current page address somewhere else in the new window instead.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #4
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,461
    Thanks
    11
    Thanked 600 Times in 580 Posts
    for reduced chrome, you can use showModalDialog() instead, but even that usually has a url bar for security reasons.

    using a modal dialog package instead often provides a better user experience due to popup performance and blockers and by simply staying on the same tab through the site visit lifetime.
    my site (updated 2014/10/20)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.3, IE11:9.2, IE9:2.7, IE10:2.6, FF:16.8, CH:47.5, SF:7.8, NON-MOUSE:37%


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •