Maninder, Singh
2006-Feb-24 14:47 UTC
Appending <tr>''s to Table - Images in <tr>''s loading slowly.
While working on an application, I have run into an interesting problem for which I have no solution at this moment, hence writing to this forum. Basically, I am working on an email application that requires me to fetch data from the backend using AJAX and then I use dom to append the results dynamically to the mail display table. So far so good. So, I call a function getTableData() at the end of my page (yes, it''s not on onload of the body, it''s just at the end of the page). This function does an AJAX request, gets the JSON data from the backend, builds the <tr>''s dynamically and appends them to the table using DOM. Oh! Prior to this it also deletes the existing rows from the table, to handle Next | Previous | Last navigation (so that every click doesn''t keep increasing table size, it only appends the latest data). Now I am not facing any problems in doing this. It works perfectly. But, when I do a refresh, I see some problems. The <tr>''s that get generated dynamically, get appended to the table super fast but the images in the <tr>''s come so slowly. These are images for icons, clear.gifs, for borders etc. This gives the whole thing a very bad user experience. Ideally these images should have been cached because the first time we got all these so why do they come up so slowly next time? And this is only on refresh and only in Internet Explorer, if I click on Next | Previous things work fine. On further exploring I found that IE is sending a request for the image icon & border on every row that is getting appended. It sends the request for the image, gets a 304 (ie, image is not modified) and then shows the image. 0.0.0.0 31 ms 610 GET 304 image/gif http://mydomain/~mandiv/images/corporate_j.gif I solved this problem by calling getTableData() on onload of the body. But, since I have some iframes that call external stuff, it would take lot of time for the table to load (because IE waits for external stuff also to load before firing onload). BTW, I don''t see this problem in Firefox. It works super smoothly. Can anyone help me with this? Thanks, Mandy.
Reasonably Related Threads
- RE: Appending <tr>''s to Table - Images in <tr>''sloading slowly.
- RE: Appending <tr>''s to Table - Images in<tr>''sloading slowly.
- RE: Appending <tr>''s to Table - Imagesin<tr>''sloading slowly.
- String.protoype.toQueryParams
- RE: manipulate <td>''s and their content by grabbingtheir classNames