Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Dynamically updating the contents of a Table from another Frame.

Posted on 2007-04-07
3
Medium Priority
?
229 Views
Last Modified: 2010-04-16
I have a frameset containing two frames.
"Left" contains a series of images in a table (one image per cell).
"Right" contains one larger image in one cell of a table and associated text in another cell.
I am able to use "onClick" for each of the images in "Left" to update the source image (and Alt) of the first cell in "Right" (using "parent.right.document.MainPic") , but also need to update the text in the second cell.
I am having trouble finding out howI can reference the appropriate cell in the "Right" frame from "Left".
0
Comment
Question by:Waratah
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 15

Expert Comment

by:stanscott2
ID: 18870708
Let's assume that there's only one table in the right frame:

var tbl = parent.right.document.getElementsByTagName("table")[0];
tbl.rows(0).cells(1).innerText = "My new text";
0
 

Author Comment

by:Waratah
ID: 18872172
Previewing the frameset generates an error message relating to "tbl"  - Null or does not exist.
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 500 total points
ID: 18872723
you better use a named tag in your cells, for example in your second cell:

  <td><div id="mytext">text</div></td>

then you can access it like:

  parent.right.document.getElementById('mytext').innerHTML='new text';
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question