Jump to content

How can I refresh/change the text in a table/cell?


Recommended Posts

I want to change the content in a middle table/cell from links on the same page in another table cell. Essentially I am wanting to write text in the document that is hidden till called upon, and when called upon it is put in the table/cell specified in the link. The “wiki on a stick” project does something very similar. A (not real) code example of what I am looking for is something like this:

<table with two columns>
<collumn1 ID=”navbar”>
Link1 <content1 target=”main”>
Link2 <content2 target=”main”>
Link3 <content3 target=”main”>
</column1>
<column2 ID=”main”>
Default text (probably link 1)
</column2>
</table>

<hidden data>
<content1>
Lots of text
</content1>
<content2>
Lots of more text
</content2>
<content3>
Still more text
</content3>
</hidden data>

I realize this will probably at least involve JavaScript (I can fathom a pure html way of accomplishing this), and yes, I am trying to avoid an iframe. I have read something about writing to layers, but it wasn’t terribly clear. Any thoughts/suggestions?

Straytoasters

Link to comment
Share on other sites


well you can do

<span id="hide1" style="Visibility:hidden"> hidden crap </span>

<script language="javascript">

function unhide()

{

hide1.style.visibility = "visible";

}

function hide()

{

hide1.style.visibility = "hidden";

}

</script>

Edited by ripken204
Link to comment
Share on other sites

just and adoptaion to the above

<script language="javascript">

function unhide(id)

{

identity=document.getElementById(id);

identity.style.visibility = "visible";

}

}

function hide(id)

{

identity=document.getElementById(id);

identity.style.visibility = "hidden";

}

</script>

<a href="" onclick="unhide('hide1');">Unhide topic 1</a>

........

<span id="hide1" style="Visibility:hidden"> hidden crap </span>

.......

Edited by phkninja
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...