View Full Version : javascript in table cells

11-21-2012, 07: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.


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

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

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

11-21-2012, 09: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.

11-21-2012, 09: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.