Tech Today

[Javascript] Pop-up a new browser window with a fixed size

Posted on: May 16, 2009

One of my clients today asked me if I could send him some code that would effectively open a new browser window to a fixed height and width, with no menu bar.

This is a basic problem that might be worth knowing in the future. So here is the solution:

First you need to add this code between the <head></head> tags of your HTML document:

<script type="text/javascript">
function openpopup(address){,"","fullscreen=no,toolbar=no,status=no,

Then you will need to create a link somewhere in your document. Like so:

<a href="javascript: openpopup('')"> Click here to open the page in a new window. </a>

And vola! You are now able to open links in a new browser window! Now, this solution will also work for local html documents, but I believe it is always better practice to put the full URLs in anyways. Hope this solution works for you and enjoy!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: