|
|
|
|
|
|
|
Chapter 5: Controlling the browser window
This chapter discusses the window object and its children, which you can use to control the Web browser window. Some of these actions have changed due to the introduction of Dynamic HTML (DHTML) and the Document Object Model (DOM) in IE 5.0. Customizing the status bar You can determine the default text for the browser window's status bar using the defaultStatus property. Page 45. Changing the status bar If you need to change the status bar text on-the-fly, you can use the status property. Page 46. Describing links in the status bar There are some interesting possibilities for changing the status bar text when the user mouses over a hyperlink. It's all done with the onMouseMove event of the link object. (Note: The version in the book uses onMouseOver, which appeared to be broken in IE 5.0 when you use a hyperlink, though it works for other objects. I changed the example code to onMouseMove so that it works in IE 5.0). Pages 47-48. Jumping to a new location The navigate method of the window object allows you to cause the browser to jump to a new page when an object is clicked. Page 49. Displaying browser information The navigator object contains information about the browser used to view the page. This example displays that information. Page 50. Displaying an alert dialog box The window object includes an alert method that displays a dialog box to the user. Page 51. Prompting the user with a dialog box The prompt method display a dialog box with an edit field that can be used to gather information from the user. Page 52. Closing the browser window The window object supports a close method that allows you to close the browser window. This feature was partially curtailed beginning in IE 4.0, however, because the user must now confirm the close (this negates the need for "confirming a choice" on page 54). Page 53. Opening a new browser window The open method allows you to create a new browser window, using a variety of options. Page 55. Using the onLoad and onUnload events The window object's onLoad and onUnload methods can be used to execute script when the user enters and exits a particular page. Page 56. |
|
|
| All content © 1997-1999 Paul Thurrott |