[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

Browser DOM Manipulation Painstakingly Slow in IE8, Firefox

Asked by Eric_Friedman in Internet Explorer Web Browser, Document Object Model, JScript, JavaScript, Web Browsers

Tags: Browser, Javascript, DOM node manipulatoin

I have a cross-browser Javascript function that converts an HTML table into multiple DIVs that mimic the effect of freezing panes in MS Excel.  When scrolling the table body, the frozen <THEAD> header rows scroll horizontally but not vertically, and the frozen row label columns scroll vertically but not horizontally.  Thus the appropriate row and column label is always visible for every table cell regardless of screen size or scroll position.

The Javascript function removes the frozen rows and columns from the original table, and creates nested DIV containers for the frozen rows and columns.  It sets each DIV height and width style attributes to match each row and column in the table body so the result appears like the original HTML table but with horizontal and vertical scroll bars on the table body where necessary.

This code produces the desired appearance and functionality in all mainstream browsers, but performance varies tremendously.  For a 100 row x 11 column table It renders the resulting window in under 0.5 second in Safari and Google Chrome, about 11seconds in Firefox, and 50 seconds in IE8 on a dual-core Intel 2.4Ghz processor.

Other than completely regenerating the innerHtml within the Javascript function, does anyone have recommendations for speeding up the processing in IE8 and Firefox?   Note that it's not the Javascript code itself that's slow, but the creation of the child nodes and especially the setting of each element.style.height or element.style.pixelHeight attribute in those child nodes.

Thanks in advance,

-Eric
 
Related Solutions
Keywords: Browser DOM Manipulation Painstaking…
 
Loading Advertisement...
 
[+][-]09/30/09 06:33 PM, ID: 25465389Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/01/09 08:27 PM, ID: 25474966Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/01/09 09:46 PM, ID: 25475259Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/01/09 09:51 PM, ID: 25475281Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/02/09 06:29 AM, ID: 25477642Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/02/09 08:42 AM, ID: 25478974Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/07/09 04:47 AM, ID: 25514288Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/11/09 09:58 AM, ID: 25546516Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]10/13/09 09:26 PM, ID: 25567239Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]10/14/09 02:33 PM, ID: 25575500Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/19/09 12:46 PM, ID: 25608312Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/19/09 03:34 PM, ID: 25609586Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/13/09 02:06 AM, ID: 25812661Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]11/13/09 07:46 PM, ID: 25819312Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/21/09 04:45 PM, ID: 25880297Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 - Hierarchy / EE_QW_3_20080625