JavaScript - Opening a new window with little to no chrome

This is an old question, covered in hundreds of FAQs, but a reader asked me this today and I'm nothing if not responsive. (Especially when I know the answer. ;) The question was - how do you open a new window in JavaScript with as little chrome as possible. JavaScript makes this rather simple. The syntax to open a new window is:

foo =, varname, features);

Where features is a list of ... well, features. This includes chrome, size, and other options. I found a good list here.

So to answer the question - you can simply disable all the features that are chrome related like so:

<script> function popup() { var features = 'directories=no,menubar=no,status=no,titlebar=no,toolbar=no,width=500,height=500'; var mypopup ='', 'mypopup', features); } </script>

<form> <input type="button" onclick="popup()" value="Click me, baby"> </form>

In my features list I disabled directories, menubar, status, titlebar, and toolbar. Note though that status=no will not work in Firefox or IE7, due to security settings, which is probably a good thing.

Like This?

If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can also subscribe to the email feed to get notified of new posts.