...

View Full Version : javascript in table cells



Suwannee_guy
11-21-2012, 06:25 PM
What is the proper way to include javascript inside a table cell?

I tried inserting script inside a table with only one row and one data cell.
That worked.
Insert more data cells in the row and it fails.

Why?



<table border="1">
<tr>
<td>Text text text</td>
<td><script type="text/javascript">AudioPlayer.embed("audioplayer_1", {soundFile: "http://example.com/play/tune.mp3"})</script></td>
<td>?</td>
</tr>
</table>



For those who may ask, the script is for the "Word Press" stand alone mp3 player.

felgall
11-21-2012, 06:36 PM
Since when was an audio file tabular data? You should use a more semantic HTML setup instead of the table.

Suwannee_guy
11-21-2012, 08:03 PM
Sheesh. Could the question get any simpler? Can you answer the question or not?
If not, don't reply.
I only used that script as it was handy and as an example.

AndrewGSW
11-21-2012, 08:12 PM
The docs (http://wpaudioplayer.com/standalone/)tell you how to do this. "audioplayer_1" needs to be the id for an existing element on the page.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum