Http web server - CD-106 Part II . JavaScript Tutorial More about
CD-106 Part II . JavaScript Tutorial More about Window References In Chapter 8, you saw how to create a new window and communicate with it by way of the windowobject reference returned from the window.open()method. In this section, I show you how one of those subwindows can communicate with objects, functions, and variables in the window or frame that creates the subwindow. In scriptable browsers (except for Navigator 2), every window has a property called opener. This property contains a reference to the window or frame that held the script whose window.open() statement generated the subwindow. For the main browser window and frames therein, this value is null. Because the opener property is a valid window reference, you can use it to begin the reference to items in the original window just like a script in a child frame uses parentto access items in the parent document. The parent-child terminology doesn t apply to sub- windows, however. Listings 11-2 and 11-3 contain documents that work together in separate windows. Listing 11-2 displays a button that opens a smaller window and loads Listing 11-3 into it. The main window document also contains a text field that gets filled in when you enter text into a corresponding field in the subwindow. In the main window document, the newWindow()function generates the new window. Because no other statements in the document require the reference to the new window just opened, the statement does not assign its returned value to any variable. This is an acceptable practice in JavaScript if you don t need the returned value of a function or method. Listing 11-2: A Main Window Document
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.