Wrapping Up Chrys`s Approach to Active Client Pages
In this last part of a 12-part series, we get the conclusion to Chrys’s Approach to Active Client Pages. Before the conclusion, we shall look at a simple example. We'll also talk briefly about HTML documents, and explain which browsers work well with ACP and which ones do not.
Wrapping Up Chrys`s Approach to Active Client Pages - A Note on HTML Documents (Page 3 of 4 )
I will use the HTML documents of the above example to illustrate my point. The window for page2_2 produces the window that has the above two documents. While producing this window, it gives it a name, page3D0 (not indicated above – see zip file). Know that this name is for the window and not for the first document that comes with the window.
After opening this window, whatever you write to the window goes to form the first document, Doc0 in the tree (fig12.1). Doc0 produces Doc1 (see fig 12.1). The parent window (opener) for either of these documents is the page2_2 window and not page3D0.
Problems with More than One Ajax Call in sequence
The window at level 1 above can produce two other windows. It has two Ajax code segments that download the strings for the two windows in advance. After the first Ajax code segment has been downloaded, the next one should to be downloaded, after some time delay. If you do not do this, you may experience a conflict with the two Ajax code segments. So if you have more than one Ajax code segment, the second code should be executed after some delay; the third one, after more delay; and so on.
Advice on Opening the Pages
Look at the tree in fig.12.1 and note that it is possible for the user to end up opening all the pages of the tree. Having all those pages open on the screen may confuse the user. You can set up a mechanism in your code that will ensure that only pages in one chain can be opened at a time.
The Browsers that Worked with the Example
The above example worked well with Internet Explorer 6. The only problem is that after using the Back and Forward buttons for the documents, Doc0 and Doc1, Doc1 could no longer obtain the reference to its parent; that is, it could no longer obtain the reference to its opener.
The example worked to a reasonable extent with Mozilla Firefox 2 and Netscape 8. The problem here was with the document pages. If the session consisted only of the documents, there wouldn’t have been any problem, but as we have the document phase incorporated into the window phase, Mozilla Firefox 2 and Netscape 8 were not able to handle the incorporated document phase.
The performance for Opera 9 was not as good as for Mozilla Firefox 2 and Netscape 8. The example did not work with Safari 3.
So for now, if your ACP design uses the window phase with the document phase incorporated, use Internet Explorer 6 and above. If your ACP design uses either only the window phase or only the document phase, then you can use Internet Explorer 6 and above or Mozilla Firefox 2 and above or Opera 9 and above. If you have a session made up of the document phase alone, Netscape 8 will not handle it.
As newer versions of these browsers are released, they should be able to handle ACP better. Everything I have written on ACP is based on the HTML, XHTML, JavaScript and the HTML DOM specifications. So the more modern a browser is, the more it should respond to these specifications.
Popups
When you use the window open() method, a new window opens up. These opened windows are called popups. Some browsers disable this feature by default. You may have to enable this feature in your browser. Learn how to do that from the help file of your browser.