On Sun, 19 May 2013 16:37:42 -0700, fulio pen wrote:
> Line 88, Column 31: Element script not allowed as child of element tbody
> in this context. (Suppressing further errors from this subtree.)
What it means is that you can't use <script></script> at that point in a
table.
However, you don't need to put script in that point in the table at all.
If you want a script to run when the document body is loaded, it may be
better to put it in the document head script section as a function, and
then use the onload attribute of the body to call it.
In addition, your calls to the javascript functions from links will not
work that way. If you want to call a javascript function from a link, you
need to specify the javascript protocol and the function, eg:
<a href="javascript:function();" ....>link text</a>
However, it is often just as easy to call Javascript functions using the
onclick handler of a span or some other element.
<span onclick="function();" ....>text</span>
Finally, sorting the data will not change the table, you need to
(re)populate the table with the sorted data afterwards.
I've just edited my example, if you looked at it earlier you may want to
look again - I realised I was doing extra work manipulating the table
that wasn't needed.
--
Denis McMahon,
denismf...@gmail.com