Ok this is probably more of a javascript/html question more than a scriptaculous question. We have a site and we want to make sure that scriptaculous is loaded absolutely last (after all images/html has loaded). I''m not quite sure that the onload event is enough (does it wait for every thing to render before it executes the onload event (including the download of images). If anyone knows the specifics of onload timing it would really help me out. Also i don''t think this is possbile but i should ask. what would be really great is to see if a cached copy of scriptaculous is already in memory (or on the local cache) and if it is load it otherwise wait until the page is done loading. The object of this all is to maximize the page loading (so the end user sees the content before extra stuff is (such as eyecandy) is loaded). Thanks for any help you guys might have. -D --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Your browser already checks for locally cached copies. Javascript has no access to the browser''s cache, so part of what you''re asking for--as I understand your question--can''t be done. The loading of script.aculo.us should have a negligible effect on page load, especially if you serve only the specific scriptaculous components you need, and use a minimized or gzipped version. It''s what you do with it on page load that adds the slowdowns. Perhaps you should consider some lazy behavior assignment. Dean Edwards has done some good work, which you should become familiar with, regarding the onload event. http://dean.edwards.name/weblog/2005/09/busted/ http://dean.edwards.name/weblog/2006/06/again/ TAG tomg-PGZyUNKar/Q@public.gmane.org On Feb 8, 2007, at 3:50 PM, D wrote:> > Ok this is probably more of a javascript/html question more than a > scriptaculous question. We have a site and we want to make sure that > scriptaculous is loaded absolutely last (after all images/html has > loaded). I''m not quite sure that the onload event is enough (does it > wait for every thing to render before it executes the onload event > (including the download of images). If anyone knows the specifics of > onload timing it would really help me out. > Also i don''t think this is possbile but i should ask. what would be > really great is to see if a cached copy of scriptaculous is already in > memory (or on the local cache) and if it is load it otherwise wait > until the page is done loading. The object of this all is to maximize > the page loading (so the end user sees the content before extra stuff > is (such as eyecandy) is loaded). Thanks for any help you guys might > have. > -D > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Tom Gregory wrote:> The loading of script.aculo.us should have a negligible effect on > page load, especially if you serve only the specific scriptaculous > components you need, and use a minimized or gzipped version. It''s > what you do with it on page load that adds the slowdowns. Perhaps > you should consider some lazy behavior assignment. >Speaking of minimization and gzipping... this week my server-admin buddy did some tests with Prototype/SAU and discovered the following: - Using Douglas Crocker''s JSMin shrinks Prototype by 24% and each of the SAU files by 20-30% (and produces no errors!) - Apache gzipping reduces Prototype/SAU by over 90% ... which leads me to my question: Should we work toward building a commented version of Prototype and SAU? I''d even vote for JavaDoc-type verbosity. --Ken --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Try the defer option : <SCRIPT SRC="xyz.js" DEFER ></SCRIPT> Works only in IE. -----Original Message----- From: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org]On Behalf Of Tom Gregory Sent: Friday, February 09, 2007 5:08 AM To: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Subject: [Rails-spinoffs] Re: Load last Your browser already checks for locally cached copies. Javascript has no access to the browser''s cache, so part of what you''re asking for--as I understand your question--can''t be done. The loading of script.aculo.us should have a negligible effect on page load, especially if you serve only the specific scriptaculous components you need, and use a minimized or gzipped version. It''s what you do with it on page load that adds the slowdowns. Perhaps you should consider some lazy behavior assignment. Dean Edwards has done some good work, which you should become familiar with, regarding the onload event. http://dean.edwards.name/weblog/2005/09/busted/ http://dean.edwards.name/weblog/2006/06/again/ TAG tomg-PGZyUNKar/Q@public.gmane.org On Feb 8, 2007, at 3:50 PM, D wrote:> > Ok this is probably more of a javascript/html question more than a > scriptaculous question. We have a site and we want to make sure that > scriptaculous is loaded absolutely last (after all images/html has > loaded). I''m not quite sure that the onload event is enough (does it > wait for every thing to render before it executes the onload event > (including the download of images). If anyone knows the specifics of > onload timing it would really help me out. > Also i don''t think this is possbile but i should ask. what would be > really great is to see if a cached copy of scriptaculous is already in > memory (or on the local cache) and if it is load it otherwise wait > until the page is done loading. The object of this all is to maximize > the page loading (so the end user sees the content before extra stuff > is (such as eyecandy) is loaded). Thanks for any help you guys might > have. > -D > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---