background
|
|
Computer

Linux
Linux Support
A small area on the internet for Linux Support.
More icon
|
|
Up Image
Navigation
Search this Site
Enter your search terms

Site Breadcrumb - You are here
|
Thau's JavaScript Tutorial
Lesson 3

by Thau!

Page 3 — Window Manipulation in JavaScript

While opening windows in HTML is very handy, it's also limiting; the Web browser controls how the window looks. You have no control over the size of the window or what the window looks like. Happily, JavaScript gives you this control.

Here's how:

window.open("URL","name","features");

This statement opens a window with the URL that you list as the first parameter in the method call. Above it's called "URL," but in an actual call you'd write "/" or something similar.

The second parameter of the method call is the window's name. This is just like the name we saw in the last page. If you open a window and there's already a window open with the same name, the URL in your open statement will be sent to that open window.

The third parameter, features, is a list of the different components a window can have. It's an optional parameter, so let's do some examples with the first two parameters before checking out features.

Here are some examples of using JavaScript to open windows.

next page»