Archive for December, 2007

Web site designers - 256 Part III . Document Objects Reference back()

Friday, December 21st, 2007

256 Part III . Document Objects Reference back() forward() Returns: Nothing. Compatibility NN2 NN3 NN4 . NN6 . IE3/J1 IE3/J2 IE4 IE5 IE5.5 The purpose of the window.back()and window.forward() methods in NN4 is to offer a scripted version of the global back and forward navigation buttons, while allowing the history object to control navigation strictly within a particular window or frame as it should. These window methods did not catch on in IE (and the window object is out of the scope of the W3C DOM Level 2), so you are better off staying with the historyobject s methods for navigating through browser history. For more information about version compatibility and the back and forward navigation, see the history object in Chapter 17. On the Example on the CD-ROM CD-ROM Related Items: history.back(), history.forward(), history.go() methods. captureEvents(eventTypeList) Returns: Nothing. NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility . In Navigator 4, an event filters down from the window object and eventually reaches its intended target. For example, if you click a button, the click event first reaches the window object; then it goes to the document object; and eventually (in a split second) it reaches the button, where an onClick event handler is ready to act on that click. The NN4 trickle-down event propagation mechanism allows window, document, and layer objects to intercept events and process them prior to reaching their intended targets (or preventing them from reaching their destinations entirely). But for one of these outer containers to grab an event, your script must instruct it to capture the type of event your application is interested in preprocessing. If you want the window object to intercept all events of a particular type, use the window.captureEvents()method to turn that facility on. windowObject.captureEvents()
In case you need quality webspace to host and run your web applications, try our personal web hosting services.

255Chapter 16 .Window and Frame Objects Methods alert( message ) (Web server info)

Friday, December 21st, 2007

255Chapter 16 .Window and Frame Objects Methods alert( message ) Returns: Nothing. NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility . . . An alert dialog box is a modal window that presents a message to the user with a single OK button to dismiss the dialog box. As long as the alert dialog box is showing, no other application or window can be made active. The user must dismiss the dialog box before proceeding with any more work in the browser. The single parameter to the alert() method can be a value of any data type, including representations of some unusual data types whose values you don t normally work with in JavaScript (such as complete objects). This makes the alert dialog box a handy tool for debugging JavaScript scripts. Anytime you want to monitor the value of an expression, use that expression as the parameter to a temporary alert() method in your code. The script proceeds to that point and then stops to show you the value. (See Chapter 45 for more tips on debugging scripts.) What is often disturbing to application designers is that all JavaScript-created modal dialog boxes (via the alert(), confirm(), and prompt() methods) identify themselves as being generated by JavaScript or the browser. The look is particularly annoying in browsers before NN4 and IE4, because the wording appears directly in the dialog box s content area, rather than in the title bar of the dialog box. The purpose of this identification is to act as a security precaution against unscrupulous scripters who might try to spoof system or browser alert dialog boxes, inviting a user to reveal passwords or other private information. These identifying words cannot be overwritten or eliminated by your scripts. You can simulate a modal dialog box window in a cross-browser fashion (see an article at http:// developer.netscape.com/viewsource/goodman_modal/goodman_modal.html), but it is not as robust as a genuine modal window, which you can create in IE4+ via the window.showModalDialog()method. Because the alert()method is of a global nature (that is, no particular frame in a multiframe environment derives any benefit from laying claim to the alert dialog box), a common practice is to omit all window object references from the statement that calls the method. Restrict the use of alert dialog boxes in your HTML documents and site designs. The modality of the windows is disruptive to the flow of a user s navigation around your pages. Communicate with users via forms or by writing to separate document window frames. On the CD-ROM Example (with Figure 16-10 and Listing 16-20) on the CD-ROM Related Items: window.confirm(), window.prompt() methods. windowObject.alert()
Please visit our professional web hosting services to find out about cheap and reliable webhost service that will surely answer all your demands.

Web server hosting - 254 Part III . Document Objects Reference top

Thursday, December 20th, 2007

254 Part III . Document Objects Reference top Value: Window object refererence Read-only Compatibility NN2 . NN3 . NN4 . NN6 . IE3/J1 . IE3/J2 . IE4 . IE5 . IE5.5 . The window object s top property refers to the topmost window in the docu ment object hierarchy. For a single-frame window, the reference is to the same object as the window itself (including the self and parentproperties), so do not include windowas part of the reference. In a multiframe window, the top window is the one that defines the first frameset (in case of nested framesets). Users don t ever really see the top window in a multiframe environment, but the browser stores it as an object in its memory. The reason is that the top window has the road map to the other frames (if one frame should need to reference an object in a different frame), and its children frames can call upon it. Such a reference looks like top.functionName([parameters]) For more about the distinction between the top and parent properties, see the in-depth discussion about scripting frames at the beginning of this chapter. See also the example of the parentproperty for listings that demonstrate the values of the top property. Related Items: window.frames, window.self, window.parent properties. window Value: Window object Read-only NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility . . . Listing the windowproperty as a separate property may be more confusing than helpful. The window property is the same object as the window object. You do not need to use a reference that begins with window.window. Although the window object is assumed for many references, you can use windowas part of a reference to items in the same window or frame as the script statement that makes that reference. You should not, however, use windowas a part of a reference involving items higher up in the hierarchy (topor parent). windowObject.window
Please visit Domain Name Hosting services for high quality webhost to host and run your jsp applications.

253Chapter 16 .Window and Frame Objects (Linux web host) At the

Thursday, December 20th, 2007

253Chapter 16 .Window and Frame Objects At the bottom of the browser window is a statusbar. Part of that bar includes an area that normally discloses the document loading progress or the URL of a link that the mouse is pointing to at any given instant. You can control the temporary content of that field by assigning a text string to the window object s statusproperty (Figure 16-9). You should adjust the statusproperty only in response to events that have a temporary effect, such as a link or image map area object s onMouseOver event handler. When the status property is set in this situation, it overrides any other setting in the statusbar. If the user then moves the mouse pointer away from the object that changes the statusbar, the bar returns to its default setting (which may be empty on some pages). Figure 16-9: The statusbar can be set to display a custom message when the pointer rolls over a link. Use this window property as a friendlier alternative to displaying the URL of a link as a user rolls the mouse around the page. For example, if you d rather use the statusbar to explain the nature of the destination of a link, put that text into the statusbar in response to the onMouseOver event handler. But be aware that experienced Web surfers like to see URLs down there. Therefore, consider creating a hybrid message for the statusbar that includes both a friendly description followed by the URL in parentheses. In multiframe environments, you can set the window. status property without having to worry about referencing the individual frame. On the CD-ROM Example (with Listings 16-17, 16-18, and 16-19) on the CD-ROM Related Items: window.defaultStatus property; onMouseOver, onMouseOut event handlers; link object. statusbar toolbar See locationbar. windowObject.statusbar
We highly recommend you visit web and email hosting services if you need stable and cheap web hosting platform for your web applications.

252 Part III . Document Objects Reference self (Web design software)

Wednesday, December 19th, 2007

252 Part III . Document Objects Reference self Value: Window object reference Read-only Compatibility NN2 . NN3 . NN4 . NN6 . IE3/J1 . IE3/J2 . IE4 . IE5 . IE5.5 . Just as the windowobject reference is optional, so too is the selfproperty when the object reference points to the same window as the one containing the reference. In what may seem to be an unusual construction, the selfproperty represents the same object as the window. For instance, to obtain the title of the document in a single-frame window, you can use any of the following three constructions: window.document.title self.document.title document.title Although selfis a property of a window, you should not combine the references within a single-frame window script (for example, don t begin a reference with window.self, which has been known to cause numerous scripting problems). Specifying the self property, though optional for single-frame windows, can help make an object reference crystal clear to someone reading your code (and to you, for that matter). Multiple-frame windows are where you need to pay particular attention to this property. JavaScript is pretty smart about references to a statement s own window. Therefore, you can generally omit the self part of a reference to a same-window document element. But when you intend to display a document in a multiframe window, complete references (including the self prefix) to an object make it much easier on anyone who reads or debugs your code to track who is doing what to whom. You are free to retrieve the selfproperty of any window. The value that comes back is a window object reference. On the Example (with Listing 16-16) on the CD-ROM CD-ROM Related Items: window.frames, window.parent, window.top properties. sidebar See appCore. status Value: String Read/Write NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility . . . windowObject.status
If you are in need for cheap and reliable webhost to host your website, we recommend http web server services.

Net web server - 251Chapter 16 .Window and Frame Objects NN6 provides

Wednesday, December 19th, 2007

251Chapter 16 .Window and Frame Objects NN6 provides the screenX and screenYproperties to read the position of the outer boundary of the browser window relative to the top-left coordinates (0,0) of the video monitor. The browser window includes the four-pixel wide window sizing bars that surround Win32 windows. Therefore, when the NN6/Win32 browser window is maximized, the values for both screenX and screenYare -4. Netscape does not provide the equivalent measures of the browser window client area as found in the screenLeftand screenTop properties of IE5. You can, however, find out if various toolbars are visible in the browser window (see window.directories). Both properties can be changed by script to alter the location of the window, but the window.moveTo()and window.moveBy() methods are more convenient, because only one statement is needed to handle both coordinates. On the CD-ROM Example on the CD-ROM Related Items: window.moveTo(), window.moveBy() methods. scrollbars See directories. scrollX scrollY Value: Integer Read-Only Compatibility NN2 NN3 NN4 NN6 . IE3/J1 IE3/J2 IE4 IE5 IE5.5 The NN6 scrollXand scrollY properties let you determine the horizontal and vertical scrolling of a window. Scrolling is possible only if the window displays scrollbars along the desired axis. Values are pixel integers. While the IE DOM does not provide similar properties for the window, the same information can be derived from the body.scrollLeft and body.scrollTop properties. On the Example on the CD-ROM CD-ROM Related Items: body.scrollLeft, body.scrollTop properties. windowObject.scrollX
From our experience, we can recommend PHP5 Web Hosting services, if you need affordable webhost to host and run your web application.

250 Part III . Document (Medical web site) Objects Reference Example

Tuesday, December 18th, 2007

250 Part III . Document Objects Reference Example See Chapter 28 for examples of using the screen object to determine the video monitor characteristics of the computer running the browser. Related Items: screen object. screenLeft screenTop Value: Integer Read-only NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility . IE5+ (but not IE5/Mac) provides the screenLeftand screenTop properties of the window object to let you read the pixel position (relative to the top-left 0,0 coordinate of the video monitor) of what Microsoft calls the client area of the browser window. The client area excludes most window chrome, such as the title bar, address bar, and the window sizing bar. Therefore, when the IE5 browser window is maximized (meaning that no sizing bars are exposed), the screenLeftproperty of the window is 0, while the screenTopproperty varies depending on the combination of toolbars the user has elected to display. For non-maximized windows, if the window has been positioned so that the top and/or left part of the client area are out of view, their property values will be negative integers. These two properties are read-only. You can position the browser window via the window.moveTo() and window.moveBy()methods, but these methods position the top-left corner of the entire browser window, not the client area. IE browsers, through version 5.5, do not provide properties for the position of the entire browser window. On the Example on the CD-ROM CD-ROM Related Items: window.moveTo(), window.moveBy() methods. screenX screenY Value: Integer Read/Write NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility . windowObject.screenX
We recommend you use shared web hosting services, because many users agree that it is cheap, reliable and customer-satisfying webhost.

249Chapter 16 .Window and Frame Objects Example (with (Web space)

Tuesday, December 18th, 2007

249Chapter 16 .Window and Frame Objects Example (with Figure 16-8 and Listings 16-14 and 16-15) on the CD-ROM On the CD-ROM Related Items: window.frames, window.self, window.top properties. personalbar See directories. returnValue Value: Any data type Read/Write NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility . Scripts use the returnValueproperty in a document that loads into the IE-specific modal dialog box. A modal dialog box is generated via the showModalDialog() method, which returns whatever data has been assigned to the returnValueproperty of the dialog box window before it closes. This is possible because script processing in the main window freezes while the modal dialog box is visible. As the dialog box closes, a value can be returned to the main window s script right where the modal dialog box was invoked, and the main window s script resumes executing statements. On the Example on the CD-ROM CD-ROM Related Items: showModalDialog() method. screen Value: screen Object Read-only NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility . . Although the screen object appears as a property of the window object only in the most recent browsers, the screenobject is also available in NN4 (see Chapter 28), but as a standalone object. Because you can omit any reference to the window object for a window object s properties, the same window-less reference syntax can be used for compatibility across all browsers that support the screen object. That s the way I recommend referring to the screenobject. windowObject.screen
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.

Web host server - 248 Part III . Document Objects Reference parent

Monday, December 17th, 2007

248 Part III . Document Objects Reference parent Value: Window object reference Read-only Compatibility NN2 . NN3 . NN4 . NN6 . IE3/J1 . IE3/J2 . IE4 . IE5 . IE5.5 . The parent property (and the topproperty that follows later in this section) comes into play primarily when a document is to be displayed as part of a multi- frame window. The HTML documents that users see in the frames of a multiframe browser window are distinct from the document that specifies the frameset for the entire window. That document, though still in the browser s memory (and appearing as the URL in the location field of the browser), is not otherwise visible to the user (except in the Source View). If scripts in your visible documents need to reference objects or properties of the frameset window, you can reference those frameset window items with the parent property (do not, however, expand the reference by preceding it with the window object, as in window.parent.propertyName, as this causes problems in early browsers). In a way, the parent property seems to violate the object hierarchy because, from a single frame s document, the property points to a level seemingly higher in precedence. If you didn t specify the parentproperty or instead specified the self property from one of these framed documents, the object reference is to the frame only, rather than to the outermost framesetting window object. A nontraditional but perfectly legal way to use the parent object is as a means of storing temporary variables. Thus, you could set up a holding area for individual variable values or even an array of data. These values can then be shared among all documents loaded into the frames, including when documents change inside the frames. You have to be careful, however, when storing data in the parent on the fly (that is in response to user action in the frames). Variables can revert to their default values (that is, the values set by the parent s own script) if the user resizes the window in early browsers. A child window can also call a function defined in the parent window. The reference for such a function is parent.functionName([parameters]) At first glance, it may seem as though the parentand top properties point to the same framesetting window object. In an environment consisting of one frameset window and its immediate children, that s true. But if one of the child windows was, itself, another framesetting window, then you wind up with three generations of windows. From the point of view of the youngest child (for example, a window defined by the second frameset), the parent property points to its immediate parent, whereas the topproperty points to the first framesetting window in this chain. On the other hand, a new window created via the window.open() method has no parent child relationship to the original window. The new window s topand parent point to that new window. You can read more about these relationships in the Frames section earlier in this chapter. windowObject.parent
Please visit our professional web hosting services to find out about cheap and reliable webhost service that will surely answer all your demands.

247Chapter 16 .Window and Frame Objects outerHeight (Hosting web) outerWidth

Monday, December 17th, 2007

247Chapter 16 .Window and Frame Objects outerHeight outerWidth See innerHeight and innerWidth, earlier. pageXOffset pageYOffset Value: Integer Read-only NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility . The top-left corner of the content (inner) region of the browser window is an important geographical point for scrolling documents. When a document is scrolled all the way to the top and flush left in the window (or when a document is small enough to fill the browser window without displaying scrollbars), the document s location is said to be 0,0, meaning zero pixels from the top and zero pixels from the left. If you were to scroll the document, some other coordinate point of the document would be under that top-left corner. That measure is called the page offset, and the pageXOffset and pageYOffsetproperties let you read the pixel value of the document at the inner window s top-left corner: pageXOffset is the horizontal offset, and pageYOffsetis the vertical offset. The value of these measures becomes clear if you design navigation buttons in your pages to carefully control paging of content being displayed in the window. For example, you might have a two-frame page in which one of the frames features navigation controls, while the other displays the primary content. The navigation controls take the place of scrollbars, which, for aesthetic reasons, are turned off in the display frame. Scripts connected to the simulated scrolling buttons can determine the pageYOffsetvalue of the document, and then use the window.scrollTo() method to position the document precisely to the next logical division in the document for viewing. IE4+ has corresponding values as bodyobject properties: body.scrollLeft and body.scrollTop (see Chapter 18). On the Example (with Listing 16-13) on the CD-ROM CD-ROM Related Items: window.innerHeight, window.innerWidth, body.scrollLeft, body.scrollTop properties; window.scrollBy(), window.scrollTo() methods. windowObject.pageXOffset
Go visit our java server pages services for a reliable, lowcost webhost to satisfy all your needs.