You could do something along the lines of:

var rows = [];
$('#srTable > tbody').each(function(i) {
    var col = $('.merchantClass', this);
    var distance = $('.sortDistance', this);
    // Something more
    rows.push({row: this, col: col, index: i});
});

If you can change .merchantClass to the tag.class like div.merchantClass it
will be faster. If you know that .merchantClass is within a div in your row
$('> div > div.merchantClass', this) would be even faster yet.

Hope this helps!

-Jonathan


On 1/23/08, Potluri <[EMAIL PROTECTED]> wrote:
>
>
>
> Hi,
> I'm working on jquery from couple of months. I'm facing a variety problem
> which can be solved by jquery Pro's.
>
> I've a table with 6 colomns on each row. I'm looping through all of this
> rows on page load beacuse my framework requires to do that.
> I'm doing it this way for table with id="srTable"..
>
> var tbody = $('#srTable tbody')[0], trows = tbody.rows;
>
> var rows=[];
>
> for( var i = 0, n = trows.length;  i < n;  ++i )
>        {
>                var row = trows[i];
>                var col = $(".merchantClass",row);
>                var distance=$(".sortDistance",row).html();
>                //doing something more
>                rows.push({ row:row, col:col, index:i});
>
>
>
>        }
>
> This process looping through rows and saving each rows colomn and doing
> something more is fine if number of rows are less than 200.
> If the row count is 400 the page just freezes and the whole onload is
> taking
> 8-11 secs.
>
> Can anyone of you can help me in reducing it to <3 secs.
>
> It'll be grateful.
>
> Thanks in advance.
> Vijay Potluri
> --
> View this message in context:
> http://www.nabble.com/how-to-make-page-onload-quicker-tp15051222s27240p15051222.html
> Sent from the jQuery General Discussion mailing list archive at Nabble.com
> .
>
>

Reply via email to