Home arrow HTML arrow Page 2 - More Tricks with Web Page Dialog Boxes
HTML

More Tricks with Web Page Dialog Boxes


In this fourth part of a five-part series that details some of the things you can do with web page dialog boxes, you will learn how to change and add content to the immediate parent box, add a row to a parent dialog box, and much more.

Author Info:
By: Chrysanthus Forcha
Rating: 5 stars5 stars5 stars5 stars5 stars / 3
January 20, 2009
TABLE OF CONTENTS:
  1. · More Tricks with Web Page Dialog Boxes
  2. · Parent Table
  3. · Already Prepared Dialog Boxes
  4. · Executing a Function in Another Window
  5. · Accessing Value in an Ancestor Window

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
More Tricks with Web Page Dialog Boxes - Parent Table
(Page 2 of 5 )

Setting and Reading Parent HTML TD Content

The method is similar to the above, but instead of the value property, you use the innerHTML property.

Assume that you have the following element in the parent window:


<table>

<tr>

<td id="TD1">

The cell content

</td>

</tr>

</table>


The following statement in the child script would set the content of the table cell element to “New Cell Content.”


myParent.document.getElementById('TD1').innerHTML = "New Cell Content"


The following code in the child script would read the content of the table cell element from the parent window into a variable in the child window:


var content = myParent.document.getElementById ('TD1').innerHTML;


Adding a Row in a Parent Table

Here, we shall see how you can add a row to a table in the parent dialog box. The process is the opposite of adding a row to a table in the child window.

The following statement will insert a row in a table in the parent window:


myParent.document.getElementById('myTableID').insertRow(index)


When you insert a row, the row is empty; you need to insert cells. When you insert a cell, it is empty; you need to insert its content. Once you have the reference, the process is the same as the one we learned in the previous part of the series.


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 10 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials