[Javascript] object sort fails in IE
Flavio Gomes
flavio at economisa.com.br
Mon Apr 19 14:14:49 CDT 2004
Check your code:
if ( a.labelString < b.labelString ) { result = 1; }
if ( b.labelString > a.labelString ) { result = -1; }
Shouldn't it be:
if ( a.labelString < b.labelString ) { result = 1; }
if ( a.labelString > b.labelString ) { result = -1; }
You reversed the "<" and the order of "a" & "b" should've reversed only one
of them.
(Hope that's it)
---
Flavio Gomes
flavio at economisa.com.br
----- Original Message -----
From: "Hassan Schroeder" <hassan at webtuitive.com>
To: "[JavaScript List]" <javascript at LaTech.edu>
Sent: Monday, April 19, 2004 2:58 PM
Subject: [Javascript] object sort fails in IE
> Starting off the week with a "huh?!" -- I have an object sort that
> works as expected (using one of the object attributes as the key)
> in Mozilla/Firebird both ascending and descending, but fails very
> strangely in IE 5.5/Win.
>
> In IE, descending order seems to single-step, and eventually gets
> to the proper order; repeatedly sorting ascending never (seemingly)
> gets to a correct and final order.
>
> My test case is longish, so it's here:
> <http://webtuitive.com/samples/sort-test-case.html>
>
> Any thoughts appreciated :-)
>
> --
> Hassan Schroeder ----------------------------- hassan at webtuitive.com
> Webtuitive Design === (+1) 408-938-0567 === http://webtuitive.com
>
> dream. code.
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
More information about the Javascript
mailing list