Thierry Posted July 12, 2007 Share Posted July 12, 2007 I have a while loop (4096 is the minimum amount) which goes through a long list of cells. Although saving 4096 cells is do-able, when it gets more, the browser thinks the script has gotten stuck and it takes forever to finish it. In the loop, all it does is get the table cell ('with frames["framename"].document.getElementById(tile_counter)') and then get a style from it and checks a few things with the result. When a result matches a certain thing, it will update a field with the value. I'll end up with a hidden field having a lot of values separated by commas. (green,black,yellow,red,purple etc) When I removed the getElementById part the script was finished instantly, so I'm geussing using 4096 getElementById's is what is causing the lag. Is there another way of getting the table cell without causing much lag? I only need the style.backgroundColor attribute. Quote Link to comment Share on other sites More sharing options...
micah1701 Posted July 13, 2007 Share Posted July 13, 2007 i'm not sure i get your problem. are you saying you're changing the background color of every <td></td> cell in a table and there are 4,096 cells? if so, might I ask, why not just set the background color for the entire table? that would be 1 css action instead of 4,096. --never mind: maybe you could post a snippet of code, i'm not sure what you're trying to do. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.