Setting size for new window

How would I create a new window with a set size and without the navigation buttons?
kch011099Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mayhewCommented:
Try this:




<form name="myform">
  <input type="button" name="go" value="Go" onclick="ShowWindow()">
</form>


<script language=javascript>
function ShowWindow(){
  MyWindow = window.open("http://www.microsoft.com","MessageWindow","toolbar=no,height=250,width=250")
}
</script>



MyWindow is a variable that you can use to reference the new window in your javascript.

The first argument in the function is the URL.

The second is that name of the new window.

The third argument is a string that holds all of your options.  Height and width are in pixels.


It should be noted that you don't have to create a seperate function to open the window.  I just did it that way to try to give a complete solution.

A shorter version could be:


<form name="myform">
  <input type="button" name="go" value="Go" onclick='window.open("http://www.microsoft.com","MessageWindow","toolbar=no,height=250,width=250")'>
</form>


Note the alternating single and double quotes after the onclick.


Let me know if this answers your question.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
srividya_krisCommented:
mayhew has provided U the almost complete answer.
If U want to avoid creating a page with only a button control U can call the js function  show_window() on "onload" event of the <body> tag of the page.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.