Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #19834

Re: Sorting

From Denis McMahon <denismfmcmahon@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: Sorting
Date 2013-05-20 00:37 +0000
Organization A noiseless patient Spider
Message-ID <knbr87$hkc$1@dont-email.me> (permalink)
References <26eac9be-f8cb-4364-b925-51d2fee45d42@e14g2000yqp.googlegroups.com> <kn9eb8$hgp$1@news.albasani.net> <659cc1b9-694e-404a-88ad-dd158682e87a@r3g2000yqe.googlegroups.com>

Show all headers | View raw


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, denismfmcmahon@gmail.com

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Sorting fulio pen <fuliopen@yahoo.com> - 2013-05-18 17:40 -0700
  Re: Sorting Andrew Poulos <ap_prog@hotmail.com> - 2013-05-19 12:06 +1000
  Re: Sorting Scott Sauyet <scott.sauyet@gmail.com> - 2013-05-18 19:10 -0700
  Re: Sorting Denis McMahon <denismfmcmahon@gmail.com> - 2013-05-19 02:15 +0000
  Re: Sorting Stefan Weiss <krewecherl@gmail.com> - 2013-05-19 04:44 +0200
    Re: Sorting fulio pen <fuliopen@yahoo.com> - 2013-05-19 15:43 -0700
    Re: Sorting fulio pen <fuliopen@yahoo.com> - 2013-05-19 16:37 -0700
      Re: Sorting Denis McMahon <denismfmcmahon@gmail.com> - 2013-05-20 00:37 +0000
        Re: Sorting fulio pen <fuliopen@yahoo.com> - 2013-05-20 07:13 -0700
  Re: Sorting Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-19 11:23 +0200

csiph-web