|
|
Handling Windows and Frames Across Browsersby Joao Prado Maia07/13/2001 Creating and handling multiple windows through JavaScript is an important feature on many of today's web sites. More than ever we see sites that have some sort of window handling to deliver enhanced functionality, such as CNN using pop-up windows to allow the user select different content by his or her location of interest. This article aims to show the properties and methods of the
That code will open a 400 x 200 pixel window with the URL specified. The variable The textbook definition of the
This method returns a
Common applications for subwindowsOne of the reasons to use subwindows on web sites is to create special features and sections of a web sites, with sections that are not as crucial linked to through subwindows. One of the best examples I can think of is the "Vote" subsection/application of CNN.com. They have a large front page with links to all the important headlines and stories that generate traffic for them. They obviously want to keep their users on the front page with those stories right under their noses, so they designed the Vote application to create a new subwindow and post the form to this window. In this way, CNN.com keeps users on the front page of the web site while still getting its input on that certain poll. The same functionality could be added to Slashdot.org, but because this community portal is aimed at the general Unix developers, having a JavaScript-only application like that could mean support problems. This type of decision is very specific, so try to think of the terms of your audience before you begin development. The same content might be a good idea for a login form, so a subwindow could be used to show error messages or special sections for correctly logged in users. Referencing parent windows from subwindowsSometimes subwindows generated by JavaScript need to change something on the parent window, the window that created this subwindow. It is quite common to see subwindows redirect the user on the parent window, or even reload the page to change some pre-determined text. The parent window might be referenced by the
|
|
|
|
|
||||||||