222 Part III . Document Objects Reference technique, (Web hosting contract)

222 Part III . Document Objects Reference technique, which loads a fixed frameset. The listing includes a workaround for an NN4-specific behavior that prevents printing a frame. (NN4 for Windows and Unix reloads a page into a separate hidden window for printing and runs any immediate scripts in the process). For a more complete implementation that passes a parameter to the frameset so that it opens a specific page in one of the frames, see the location.search property in Chapter 17. Listing 16-2: Forcing a Frameset to Load Switching from frames to frameless Some sites load themselves in a frameset by default and offer users the option of getting rid of the frames. Only IE4+ and NN6+ let you modify a frameset s colsor rows properties on the fly to simulate adding or removing frames from the current view (see the FRAMESET element object later in this chapter). In other browsers, you cannot dynamically change the makeup of a frameset after it has loaded, but you can load the content page of the frameset into the main window. Simply include a button or link whose action loads that document into the topwindow object: top.location.href = mainBody.html A switch back to the frame version entails nothing more complicated than loading the framesetting document. Inheritance versus containment Scripters who have experience in object-oriented programming environments probably expect frames to inherit properties, methods, functions, and variables defined in a parent object. That s not the case with scriptable browsers. You can, however, still access those parent items when you make a call to the item with a complete reference to the parent. For example, if you want to define a deferred function in the framesetting parent document that all frames can share, the scripts in the frames refer to that function with this reference: parent.myFunc() You can pass arguments to such functions and expect returned values.
From our experience, we can recommend PHP5 Web Hosting services, if you need affordable webhost to host and run your web application.

Leave a Reply