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
Solved

Dynamically updating the contents of a Table from another Frame.

Posted on 2007-04-07
3
223 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
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 125 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

856 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