Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Client Scripting
Expertise: Beginner
Nov 19, 1997



Building the Right Environment to Support AI, Machine Learning and Deep Learning

window.open() method

HI! I hope you can help me. I'm opening a window with the window.open() method, and for the life of me, I can't get it to be the size I want in NS4. Here's the code: This works in IE4, but NS4 opens the new window in a full screen. I tried using innerWidth and innerHeight, they didn't work either. What am I doing wrong? Thanks for your help!

The problem here is that Navigator is more picky than Internet Explorer when parsing the third, windowFeatures, parameter. You have a space between the comma (,) after the width parameter and the height parameter. This is bad. When Netscape sees this it get all confused. Change your code to read: window.open("bbimages/" + name + ".html", "name", "width=300,height=300") Finally, as a matter of habit you show make sure that the window was actually opened as a result of your command. Use the following code to do this: newWindow = window.open("bbimages/" + name + ".html", "name", "width=300,height=300") if (newWindow != null) { // do something here with the new window }

DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date