tags:

views:

728

answers:

3

How do I hide the navigation bar for popups in javascript?

+4  A: 
window.open("http://www.google.com", "mywindow", "location=0,toolbar=0");

See this site for more attributes.

Joel Potter
+3  A: 

The above suggestion should work under most circumstances.

Beware of using pop-up's at all though; they may be inhibited by the browser, or the visitor may have set their browser to open new windows in tabs instead, causing unexpected results (especially if their tabs are opening in the background).

Depending on your purpose, you may want to consider using jQuery's dialog() instead.

Gilimanjaro
I agree, I hate websites that use popups for little informational windows.
davr
+1: I totally agree. I just didn't have the time to put all that in my answer.
Joel Potter
A: 

With modern day browsers, there are settings that will not allow you to hide the location and toolbars. There is no way around the browser security settings so setting the location=0 may not work.

epascarello