Home arrow JavaScript arrow Page 4 - Active Client Pages: DOM Roots of the Window Phase
JAVASCRIPT

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.

Author Info:
By: Chrysanthus Forcha
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
September 04, 2009
TABLE OF CONTENTS:
  1. · Active Client Pages: DOM Roots of the Window Phase
  2. · What is a document?
  3. · Can you decide whether a particular bar will be present or absent?
  4. · What about the words child, grandchild, descendant, parent, grandparent and ancestor?
  5. · How do I send content to a newly-opened window from the parent window?

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
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.


window.open("","","menubar=no,toolbar=no,width=400,height=400","")


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.


window.open("","","menubar=no,toolbar=no,width=400,height=400,left=25,top=25","")


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.


blog comments powered by Disqus
JAVASCRIPT ARTICLES

- More Top jQuery Tutorials for Beginners
- More Top jQuery Plugins for Menus
- Top jQuery Tutorials for Beginners
- New UI Framework and SDK for JavaScript Rele...
- JavaScript OpenPGP Tool, Node.js 0.6.3 Avail...
- Yahoo Releases Cocktails Language and Develo...
- Customizing jQuery Slideshows: Dynamic Contr...
- Customizing jQuery Slideshows: the animate()...
- Customizing jQuery Slideshows: slideUp() and...
- Customizing jQuery Slideshows: hide() and sh...
- Web Workers: Performing Calculations in Para...
- More Top JavaScript Frameworks and Libraries
- More Dynamic jQuery Styling Techniques
- The Top JavaScript Libraries
- The Top JavaScript Frameworks

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 8 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials