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

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
TABLE OF CONTENTS:
  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
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Finding Values and More with Web Page Dialog Boxes - Easy Way of Creating Descendant Dialog Boxes
(Page 2 of 4 )

By the word “descendant” here, I am referring to a child, grandchild, great-grandchild, and so forth, going down the chain. Remember, in part three of this series, I promised that I would show you an easy way of producing dialog boxes.

This is the basic code for the main window:


<html>

<head>


<script type="text/javascript">


//strings, where each string has the content of a dialog box.


function sendRefBack(theRef)

{

return window.self;

}

 


function openAnotherBox()

{

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

myWindow.document.write(boxStr1);

}

 

</script>

<body>

<script type="text/javascript">

window.name= "box0";

</script>

<button type="button" onclick="openAnotherBox()">Click to Open Dialog Box</button>

</body>

</html>


In the above code, the two statements to open and write to the first dialog box are:


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

myWindow.document.write(boxStr1);


Note the argument of the write() function., which is boxStr1. Now, boxStr1 is the variable of a string, whose content is the document (HTML content) of the first dialog box. This string is defined somewhere up in the main window. A function of interest is:


function sendRefBack(theRef)

{

return window.self;

}


This function is called by descendant windows. It sends the reference of the main window to the calling window. The HTML content of each dialog box is in a string, which is in the main window. A descendant dialog box needs a string from the main window to produce its child window. The descendant box uses the reference from the main window to do this.


blog comments powered by Disqus
HTML ARTICLES

- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5
- BBC Adopts HTML 5, Mozilla Addresses Issues
- Advanced Sticky Footers in HTML and CSS
- HTML and CSS Sticky Footers
- Strategy Analytics Predicts HTML5 Phones to ...
- HTML5 Guidelines for Web Developers
- Learning HTML5 Game Programming
- More Engaging CSS3 and HTML Background Effec...
- Engaging HTML and CSS3 Background Effects
- More Web Columns with CSS3 and HTML
- Columns with CSS3 and HTML
- Creating Inline-Block HTML Elements with CSS
- Drag and Drop in HTML5: Parsing Local Files

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