Active Client Pages: DOM Roots of the Window Phase
In this tenth part of a twelve-part series on Chrys's approach to Active Client Pages, we look at the factors that gave rise to the window phase. If you want to better understand this technology that allows your web pages to at least appear to load more quickly for your visitors, keep reading.
Active Client Pages: DOM Roots of the Window Phase - What about the words child, grandchild, descendant, parent, grandparent and ancestor? (Page 4 of 5 )
We create windows using the DOM objects. The specifications are not clear on these words. In this series, when a window opens a new one, the new window is the child. The window that opened it is the parent. When a child opens its own window, the parent has a grand child. The child window sees the parent as grandparent.
In this series, children, grandchildren and great-grandchildren, going down, are descendants. Parent, grandparent and great-grandparents going up are ancestors. We shall respect these meanings in this series.
How do I set text in the status bar?
For the current window, it goes like this:
window.status = "This is text for the status bar.";
You can open a window and then use the window reference returned by the open() method to set text in the status bar of the opened window. Like this:
myWindow = window.open();
myWindow.status = "This is text for the status bar.";
How do I open a window and give it size at the same time?
The following line in a JavaScript will open a new window whose width is 400px and height is 400px.
Here, window refers to the current window. It is the current window that is opening a new window. When this statement is executed, a new window would be opened. The newly-opened window will not have a menu bar and will not also have a tool bar. I hope you can see that the spec parameter of the open() method has been used.
Can you open a window at a particular position on the screen?
Yes. You still have to use the spec parameter of the open() method. I gave you the description of the spec parameter in the previous part of the series. In this part I give you the details as I answer the questions. The following statement will open a window at a position 25px down from the screen top edge and 25px to the right of the left screen edge.
If the values for the left and top properties are not given, then the browser chooses a random position for you.
Are these opened windows pop-ups?
Yes, they are. By default, they will not be opened in many browsers. That is, many browsers by default disable this open-window feature. However, the user can enable this feature.