Home arrow HTML arrow Finding Values and More with Web Page Dialog Boxes

Finding Values and More with Web Page Dialog Boxes

In this conclusion to a five-part series, we'll wrap up our discussion of what you can do with web page dialog boxes. Among other things, we include some tips you'll need to keep in mind when you include web page dialog boxes in your commercial projects.

Author Info:
By: Chrysanthus Forcha
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
January 26, 2009
  1. · Finding Values and More with Web Page Dialog Boxes
  2. · Easy Way of Creating Descendant Dialog Boxes
  3. · Developing the String
  4. · Commercial Project

print this article

Finding Values and More with Web Page Dialog Boxes
(Page 1 of 4 )

Accessing Value in a Descendant Window

You may recall that in the previous part of this series, we left off with an explanation of how to access the value in an ancestor window. The process of accessing a value in a descendant window is similar. You can put the following code in the JavaScript in every window:

function followOrReturn(name)


if (window.name == name)


return window.self;




return window2.followOrReturn(name);



This function, like the one before it, is called by another function or event in the same window. The function receives the name of the descendant window that interests you as an argument. It first checks to see if the name it has received is the name of its window. If that is true, it determines the reference of the window it is in and returns it; otherwise, it forwards the request to the immediate child window, calling the same function there.

In order to call a function in the child window, it needs a reference to the child window. We have been opening child windows as follows:

childReference = window.open();

where “window ” is the window having the JavaScript code. As you can see, each time we do this, we have a reference to the child window in the parent window. From the parent window you can use this reference to do something in the child window.

When the followOrReturn(name) function is in every page, it allows messages to be propagated from child to child. This enables you to get the reference of a descendant window, if you know the name of that descendant window. You can then use the reference in whatever ancestor window you are in, to access value in the descendant window.

blog comments powered by Disqus

- Does HTML5 Need a Main Element?
- Revisiting the HTML5 vs. Native Debate
- HTML5: Not for Phone Apps?
- HTML5 or Native?
- Job Hunting? Freelancer.com Lists This Quart...
- HTML5 in the News
- Report: HTML5 Mobile Performance Lags
- The Top HTML5 Audio Players
- Top HTML5 Video Tutorials
- HTML5: Reasons to Learn and Use It
- More of the Top Tutorials for HTML5 Forms
- MobileAppWizard Releases HTML5 App Builder
- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


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