Wrapping Up Chrys`s Approach to Active Client Pages - Technical Description of the Simple Example
(Page 2 of 4 )
Each window or document which would produce another window or document, has a button for that purpose. So there is a corresponding function for that purpose in any page. The window at the first level that can produce one of two windows has two buttons for that, and two corresponding functions.
For simplicity, each window or document downloads the content of its next page, which may be a window or a document. The window at level one, which has to produce two windows, downloads the contents of the two pages.
The store is simple. It includes only the following variable and assigned value (it contains just the following statement):
var storeVarMaster = "It worked!";
The third level has one window and two documents. The parent of the one window is different from the parent of the two documents. This one window has a button which, when clicked, would display the value of the above variable. That is, the alert box would display “It worked!”
To achieve this, there is a Backward Propagation Code in each window in the chain (see fig12.1) from the master page to the window at level 3 (the master page is the first window). This code is used to retrieve the value of the variable in the master page.
The second document at the third level is produced by the first document in that level, which is produced by the window of page2-2. This second document has a button that, when clicked, will display the value of a JavaScript variable of page2-2. This variable in the window of page2_2 and its assignment is:
var storeVar2_2 = "I am 2_2";
So the alert() box will show "I am 2_2".
To save time and space, I will not explain the details of the complete code. The complete code, made up of files, is simple and self-explanatory. You can download all the files in one zip file from:
windowPhaseSimpleExample.ZIP
Next: A Note on HTML Documents >>
More JavaScript Articles
More By Chrysanthus Forcha