On Jul 11, 9:03 pm, traunic <[EMAIL PROTECTED]> wrote:
>                                 var x =
> a.childNodes[2].firstChild.innerHTML;
>                                 var y =
> b.childNodes[2].firstChild.innerHTML;
>                                 return ((x < y) ? -1 : ((x > y) ? 1 :
...
>                                 var x =
> a.childNodes[4].firstChild.innerHTML;
>                                 var y =
> b.childNodes[4].firstChild.innerHTML;
...
> a.childNodes[6].childNodes[1].innerHTML;
>                                 var y =
> b.childNodes[6].childNodes[1].innerHTML;
...
> Not quite as human readable or flexible (if the HTML layout changes
> this method needs to change) but the speed increase is worth it.

A small suggestion: don't hard-code those numbers. Search/replace on
hard-coded number values is an exercise in pain if the numbers show up
anywhere else in your code (e.g., a for loop). Instead, use an
internal config object, e.g.:

mySpecialInternalConfig = {colFoo:2,colBar:4,colBaz:6};

Then refer to that conf object in your array indexes.


Reply via email to