Details
-
Improvement
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Cannot Reproduce
-
3.0.0
-
None
-
IE6+ WinXP+
Description
The current function for generating color palette uses ca.400 document.write()'s function to form an HTML table on a posting page. Somehow it slows down the scripts on a page and especially those using document.selection up to 30 times (moveStart, moveEnd profiles grow from 8-10 to 280-320 ms).
Surprizingly, its deteriorating effect appears even without actual invoking of a colorPalette() function.
I wonder is it possible to move from outdated doc.writes to more up-to-date element formation?
We modified the function so that it compiles the HTML strings for future table elements in a temp. array, then
join the strings for innerHTML method:
document.getElementById('ColorTable').innerHTML=tmpArr.join('\r\n')
--This solution works on any (not so) modern browser and does not hamper scripts running.