7

How can I hide the location/address bar of popup window created using JS ? am attaching a image where I marked the place wanted to be hidden.

test

Is it possible ? I use the below script for this.

    var ctr=0;
    function openpopup(popurl){
    var winName = "New_"+(ctr++);
    winpops=window.open(popurl,winName,"height=300,width=500,top=300,left=500,scrollbars=yes,resizable")
    }

and used this to call onClick='openpopup(this.href);return false;'

Please help me for the same.

Gopipuli
  • 393
  • 1
  • 12
  • 37

4 Answers4

24

You cannot hide the address bar in modern browsers. That is a security measure. The user must always know on what page he is. Also in that address bar is shown what type of page he is in (HTTP or HTTPS) and information of that webpage if it is secure.

So, sorry, but you cannot do that.

Mihai Iorga
  • 39,330
  • 16
  • 106
  • 107
3

you can use a modal dialog. Not exactly a pop up, but it will open another container. Like an overlay. You see people doing this a lot with images, but you can also use this for html. There are a ton of plugins for jquery.

Heres one with some examples though: http://jquery.com/demo/thickbox/

I personally like http://fancybox.net/

Only problem is you can't use ajax to call another website, but you can create a page in php or whatever and get the contents of another page and then return that in ajax.

you would want to use something like curl for this.

Matt
  • 7,049
  • 7
  • 50
  • 77
1

You could have a generic page that has an embedded iframe to hide the actual page. Would be a little tricky to pass the right data though. Not really worth it imo.

wesbos
  • 25,839
  • 30
  • 106
  • 143
1

Forget window.open(). Use jquery ui or jquery tools overlay instead. A js popup window will work.

arulmr
  • 8,620
  • 9
  • 54
  • 69
  • 3
    That is a good workaround, but not really a solution. What if you want a window for a printing preview? Hiding the rest of the page for printing may not be easy stuff and may result in messy Javascript / CSS. – André Leria Nov 05 '13 at 18:36
  • This also doesn't help in my precise scenario: intranet client wants to open a window to a 3rd party shipping site. Note something we can open in a jQuery dialog, nor is it even something we can IFRAME in (the remote site explicitly blocks FRAMEd access) – Nathan Crause Aug 11 '14 at 14:45