Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Mar 2005
    Posts
    115
    Thanks
    3
    Thanked 0 Times in 0 Posts

    code to reload table cell - help please

    Hi,
    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:

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

    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
    onClick="document.includearea.something=newcontent"
    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...

  • #2
    Regular Coder
    Join Date
    Mar 2005
    Posts
    115
    Thanks
    3
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •