On Wed, 21 Feb 2007, Shane McCarron wrote: > Well - here's what we have done for the nonce: > > 1. For testing purposes, enabled the expires module in Apache and > configured it to set expires headers on images, javascript, css - > basically, > anything static that we serve up. > 2. On first access to the app, we redirect to a page that ensures > everything we might ever access this way is loaded up so it is cached > locally. These are all either in a div with display none or in a head. > 3. We then set a cookie with a long expire so we don't reload the > cache again. > > Now when the JS goes to access these things, IE has already loaded them up > in line so it knows not to phone home. > > Its a gross hack, but it seems to work. Thanks for all the advice. > > As an aside.... how do you put an image into a JS variable? And how do you > get the variables contents rendered as an image in the middle of HTML in, > for example, an iframe?
It's about 10 years since I did anything like this (ok, maybe 7 years), but it was something like: 1. Already known OO programming (or learn OO programming) 2. Learn about the HTML DOM Image Object (Google "HTML DOM Image Object" w/o quotes); http://www.w3schools.com/htmldom/dom_obj_image.asp 3. Use code something like the following (I finally remembered where I did this, and dug it out again) -------------------------------------------------- imgnamearray[0] = "Geelong"; ... for(count = 0; count < maxlinks+1 ; count++) { normimgarray[count] = new Image(128, 32); normimgarray[count].src = dir + imgnamearray[count] + 'norm.jpg'; hiimgarray[count] = new Image(128, 32); hiimgarray[count].src = dir + imgnamearray[count] + 'hi.jpg'; } ... function buttonhi(number, status) { f = 'document.' + imgnamearray[number] + '.src = hiimgarray[number].src'; eval(f); window.status = status currmsg = status return true; } ... <A HREF="main.html#Top" TARGET="main" onmouseOver="buttonhi(0, 'Go to the main RPCA Geelong Page'); showmsg() ;return true" onmouseOut="buttonnorm(0, defmsg); return true" ><IMG SRC="images/map/Geelongnorm.jpg" NAME="Geelong" ALT="Geelong" HEIGHT=32 WIDTH=128 BORDER=0 ></A> -------------------------------------------------- I've left out some stuff (like "new Array"), but that should give you the gist. Of course, it does have the disadvantage of making the page load slower, and making it hit all images where you might not need them. But it makes the page more responsive. This code was for mouseovers on a menu or something. These days it would probably all be done with an AJAX toolkit. Obviously old-school HTML before XHTML. Enjoy. :) --------------------------------------------------------------------- | Name: Tim Nelson | Because the Creator is, | | E-mail: [EMAIL PROTECTED] | I am | --------------------------------------------------------------------- ----BEGIN GEEK CODE BLOCK---- Version 3.12 GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V- PE(+) Y+>++ PGP->+++ R(+) !tv b++ DI++++ D G+ e++>++++ h! y- -----END GEEK CODE BLOCK----- ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users