On-topic: HTML/JS help please

Dominic Thoreau dominic at thoreau-online.net
Fri Feb 5 16:19:52 GMT 2010


On 5 February 2010 16:05, Dermot <paikkos at googlemail.com> wrote:
>
> I like Gianni method personally.  It's far more shiny. But here's my
> effort anyway.

>  <script type="text/javascript">
>   function toggle(num) {
>       var Tbl = document.getElementById('mytable');
>        var i;
>        for (i = 1; i < Tbl.rows[num].cells.length; ++i) {
>            alert(Tbl.rows[num].cells[i]);
>            Tbl.rows[num].cells[i].style.display = 'none';
>        }
>  }
>  </script>

You're posting on a perl list (a language with an reputation (to
outsiders) for line-noise style cryptic code, and you haven't written
it in JQuery? For shame!

Plus you can probably cut that code down quite a lot, just in
complexity and size.

Seriously, writing JavaScript without an external library is like
using Perl without CPAN. Sure you can, but why? Life's too short for
NIH....

-- 
Better to remain silent and be thought a fool than to speak out and
remove all doubt.
	-- Abraham Lincoln



More information about the london.pm mailing list