opening a new window - How do I set the size & look? (Posted by endless)

They have: 5,633 posts

Joined: Jan 1970

what are the attributes for opening a new browser window from a link... ie. I don't want a nav bar, I want it a certain size, I only want scrollbars if necessary... etc... I've searched and searched and can't find that info... but I know it's out there somewhere....

Thanks for your help!

----------
Cheers,
endless

They have: 5,633 posts

Joined: Jan 1970

function newWindow() {
var windowFeatures;
windowFeatures = 'height=400,width=400,'
windowFeatures += 'screenX=5,screenY=5,top=5,left=5,'
windowFeatures += 'location=no,menubar=no,'
windowFeatures += 'resizable=yes,scrollbars=no,'
windowFeatures += 'status=no,toolbar=no'
window.open('URL','WINDOW NAME',windowFeatures);
}

----------
[email protected]
http://go.to/hass

John Pollock's picture

He has: 628 posts

Joined: Mar 1999

I must say that is a very nice bit of code, it is wonderful if you want to open multiple windows with the same attributes, which is quite common. Way to go Lloyd (again)!

They have: 67 posts

Joined: Aug 1999

Hey Lloyd, - and others,
When you write a script, can you put the whole thing, that is include the <script>to</script> so that we can see what goes where? John says it's a neat script ( which I'm sure it is ) but others have no idea where or what part it is, or where it goes etc etc. Remember, theres alot of newbies out here and one way of learning is reading boards and looking at examples. Thanks. Ian

Webmaster A1 JavaScripts
A1 JavaScripts
Web Development - Big Resources Inc
BIG Resources.com

They have: 5,633 posts

Joined: Jan 1970

I'll try to include brief descriptions of script implementation in the future. I realise that it is hard when first learning a programming language.

----------
[email protected]
http://go.to/hass

They have: 67 posts

Joined: Aug 1999

Thank you Lloyd I really appreciate the time you put in to help others. It a great language when things work, but when they don't.....NIGHTMARES...
It's good to be able to look at sniplets and see the correct way to do it.
All the best.
Ian

Webmaster A1 JavaScripts
A1 JavaScripts
Web Development - Big Resources Inc
BIG Resources.com

They have: 2,390 posts

Joined: Nov 1998

How would you call this function?
Is the '+= ' present just for formatting reasons?
Thanks,
JP

----------
[red]The Next Step in Website Development [/red] - http://www.what-next.com
The Webmaster Promotion and Resource Center

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.