Previous Page
Next Page

Chapter 6. Working with Browser Windows

The window is the most important interface element in a Web browser, and as you might expect, JavaScript provides you with many tools to manipulate windows.

Don't Kill Those Pop-Ups!

This chapter is all about creating and working with windows using JavaScript. There's a name for these windows; they're called pop-up windows, and they've become a bane to many a Web surfer. We're going to be showing you some benign uses of pop-up windows, but if you're having trouble getting these examples to work, it may be because you've turned off pop-up windows in your browser, or because you have other software running that kills pop-up windows. While browsers should open any pop-up that you've explicitly chosen to open, some don't. So while you're working on this chapter, make sure your pop-up killers are turned off.

However, some browsers, allegedly for security reasons (we're looking at you, Microsoft Internet Explorer), will decide they know better than you and will not open pop-up windows from scripts no matter if you've asked them to or not.


JavaScript deals with windows in ways similar to that of frames (see Chapter 5). This makes perfect sense, since frames are just other document windows within the overall browser window.

In this chapter, you'll learn how to use JavaScript to open and close, update, and position windows. You'll see how you can use JavaScript to write information into windows, so you can build a Web page on the fly.


Previous Page
Next Page