Simple web server - Window andFrameObjectsAquick look at the basic document object

Window andFrameObjectsAquick look at the basic document object model diagram inChapter 14 (see Figure 14-1) reveals that the windowobject isthe outermost, most global container of all document-related objectsthat you script with JavaScript. All HTML and JavaScript activitytakes place inside a window. That window may be a standardWindows, Mac, or XWindows application-style window, complete withscrollbars, toolbars, and other chrome; you can also generate win- dows that have only some of a typical window s chrome. A frame isalso a window, even though a frame doesn t have many accou- trements beyond scroll bars. The windowobject is where everythingbegins in JavaScript references to objects. IE4+, NN6+, and W3Cbrowsers treat the frameset as a special kind of windowobject, sothat it is also covered in this chapter. Of all the objects associated with browser scripting, the windowandwindow-related objects have by far the most object-specific terminol- ogy associated with them. This necessitates a rather long chapter tokeep the discussion in one place. Use the running footers as a naviga- tional aid through this substantial collection of information. Window TerminologyThe windowobject is often a source of confusion when you firstlearnabout the document object model. A number of synonyms forwindowobjects muck up the works: top, self, parent, and frame. Aggravating the situation is that these terms are also properties of awindowobject. Under some conditions, a window is its own parent, but if you define a frameset with two frames, you have only one par- ent among a total of three windowobjects. It doesn t take long beforethe whole subject can make your head hurt. If you do not use frames in your Web applications, all of theseheadaches never appear. But if frames are part of your design plan, you should get to know how frames affect the object model. FramesThe application of frames has become a religious issue among Webdesigners: some swear by them; others swear at them. I believe therecan be compelling reasons to use frames at times. For example, if you1616CHAPTER …In This ChapterScriptingcommunication amongmultiple framesCreating and managingnew windowsControlling the size, position, andappearance of thebrowser windowDetails of window, frame, frameset, andiframeobjects …