Chapter 13 described the Window object and the central role it plays in client-side JavaScript: it is the global object for client-side JavaScript programs. This chapter explores the properties and methods of the Window object that allow you to control the browser and its windows and frames. Here, you'll find out how to:
You'll notice that this chapter is all about manipulating browser windows but does not have anything to say about the content displayed within those windows. When JavaScript was young, document content was scriptable only in very limited ways, and the window scripting techniques described in this chapter were exciting and fresh. Today, with fully scriptable documents (see Chapter 15), scripting the browser is no longer cutting-edge. Furthermore, some of the techniques shown in this chapter are hampered with security restrictions and do not function as well as they once did. Other techniques still function, but have fallen out of favor with web designers and are no longer commonly used. Although this chapter is less relevant today, it is not altogether irrelevant, and I do not recommend that you skip it. The chapter is organized so that (most of) the most important material comes first. This is followed by less important or less commonly used techniques. One important, but more complicated, section on the use of JavaScript to interact with multiple windows and frames is deferred until the end of the chapter, and the chapter concludes with a useful example. |