Jetty web server - 274Part IIIDocument Objects ReferenceListing 15-23: The window.focus() and
274Part IIIDocument Objects ReferenceListing 15-23: The window.focus() and window.blur() Methods
Window focus() and blur() Methods
A key ingredient to the success of the makeNewWindow()function in Listing 15-23 is the firstconditional expression. Because newWindis initialized as a nullvalue when the page loads, that is its value the first time through the function. But after you open the subwindow the firsttime, newWindis assigned a value (the subwindow object) that remains intact even if the usercloses the window. Thus, the value doesn t revert to nullby itself. To catch the possibility thatelementObject.blur()