Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

replacing text in a table with text

Status
Not open for further replies.

lollypop1

Technical User
Apr 13, 2005
13
GB
sorry to ask again, but there must be an easier way!

I have a chunk of text in a cell... there is a button above the cell saying 'rollover for more info'... i would then like that text replaced with different text.

I was given some javascript, but because i have header tags in the text (for SEO purposes)and it wouldnt work. i dont want to use images - also due to SEO....

Should I use layers? is this the sort of thing layers are for?

Many thanks,
 
Why can't you use JavaScript with Header tags? I'm not following you.

Greg
People demand freedom of speech as a compensation for the freedom of thought which they seldom use. Kierkegaard
 
I'm with traingamer, I don't understand why you think the JS is not going to work.

Using the innerHtml property of the cell you can change its contents.






----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
2 basic things wrong with that:

1. You have double quotes inside double quotes. This won't work as the browser can't know where the end of the javascript instruction really is, if your text has double quotes and its surrounded by double quotes.

So either change the inner double quotes to single quotes or change the outer double quotes to single quotes. The easiest option would be the second one.



and 2. Your text has line breaks. It cannot have line breaks if it is to be used as a value in a variable. So remove all line breaks. Make sure everything is in a single line.


In other words your code should look like:

Code:
 var clientData = new Array();
      clientData[1] = [red]'[/red]<H1 class="h3"><span class="eleven">A stunning dress in the style of Nicole Ritchie.</span></H1><span class="eleven"><br></span><span class="h3">Stretch duchess matt satin fabric, lined and fully boned. Ruched detailing at the side, and pleated fan detail on the front. Concealed zip fastenings.<br><br>Length from top of dress 28 inches. </span><span class="eleven"><br> <br></span>  <H2 class="h3"><span class="eleven">Designer: Elsa Haag.</span></H2>[red]'[/red];

clientData[2] = "This is Data for Client 2";




----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top