View Full Version : code to reload table cell - help please

12-18-2005, 08:09 AM
Wondering if anybody can help with some coding advice here....I think it's a javascript issue but perhaps I need PHP help instead...

I have in a PHP page code in the following form:

<div class="textcontent">
<? include("content/info01.txt"); ?>

The "info01.txt" file contains html tags including image tags. I want to be able to include links within this text file too, so that when clicked, a different set of content "info02.txt" will appear in place of the original included content. I don't want to load an entire new page though (as this is a client-changeable section and I want to limit the client to changing included text files content only, not the whole html document), so I just want to make some kind of clickable link which will replace the section within the <div> tags above so I can maintain the css of that included content.

Is there some easy way of doing this? I thought perhaps I could give the <td> an identifier (say "includearea") and within the included text file use an onClick statement to load the new content, something like
but can't work out how to code this.... what is the "something" and how could I define "newcontent"?

I'm stuck. Any suggestions would be most appreciated.

Thanks in advance...

12-19-2005, 04:36 AM
Found the answer elsewhere -
solution is by loading a hidden iframe with the new content and then copying this content to the cell using the innerHTML property.