Ryan Gahl
2006-Feb-24 14:52 UTC
RE: Appending <tr>''s to Table - Images in <tr>''sloading slowly.
I have also experienced erratic image "non"-caching by IE in my projects (seemingly related specifically to AJAX/DOM manipulated nodes as you are seeing)... I tried preloading the icon images in body onload in global variables, then using those global variables to access the images... no luck. ...I have no idea why IE sometimes has to download these images that it SHOULD have in its cache. For me, it will happen one time, then I do the same thing and it doesn''t happen, erratic. Sorry I couldn''t help, just empathizing with you :-). -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Maninder, Singh Sent: Friday, February 24, 2006 8:47 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: [Rails-spinoffs] Appending <tr>''s to Table - Images in <tr>''sloading 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. _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs The information transmitted in this electronic mail is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers.
Reasonably Related Threads
- Appending <tr>''s to Table - Images in <tr>''s loading slowly.
- RE: Appending <tr>''s to Table - Imagesin<tr>''sloading slowly.
- RE: Appending <tr>''s to Table - Images in<tr>''sloading slowly.
- RE: manipulate <td>''s and their content by grabbingtheir classNames
- Prototype.js and Coremetrics eluminate.js issues