Hi Kit, Don't know if this will help, but Simon Willison created an addLoadEvent(func) to get multiple scripts loading correctly on a page.
Please see his blog: http://simonwillison.net/2004/May/26/addLoadEvent/ Kind regards, Frank M. Palinkas Microsoft M.V.P. - Windows Help W3C HTML Working Group (H.T.M.L.W.G.) - Invited Expert M.C.P., M.C.T., M.C.S.E., M.C.D.B.A., A+ Senior Technical Communicator Web Standards & Accessibility Designer -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kit Grose Sent: Tuesday, 09 October, 2007 8:10 AM To: [email protected] Subject: [WSG] Load Javascript early or on-demand? G'day all, I've had some internal debate about this topic, so I thought I'd put it to the list: Imagine a large (300 dynamic pages+) site with a real client focus on speed. An average user is expected to visit around 5% of the site per visit (~15 pages), and the user is expected to visit with an unprimed cache around 75% of the time. One very popular page of the site expects to get hits from more than half of all visitors, and uses all kinds of (unobtrusive) Javascript goodies, requiring Script.aculo.us (and therefore Prototype). The page is the only page on the entire site that uses either library. The server is quite slow, so HTTP requests are at a premium. So the question I ask is this: do you 1. load the libraries as part of the global header on every page so that visitors to the swishy page aren't waiting an exorbitant time to view all the Javascript goodies while waiting for two entire JS libraries (and the actual behaviour for the page) to download, but extending the initial load time of the site, or 2. load the libraries on the page in question only, slowing the intra- site navigation, but not penalising users who never intend to visit that particular page of the site. In essence, is it more important to optimise the initial load time, or load-time per subsequent page? Cheers, Kit Grose Frontend Developer iQmultimedia [EMAIL PROTECTED] ******************************************************************* List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ******************************************************************* ******************************************************************* List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *******************************************************************
