Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: how to do external scripting?
09-08-2011, 11:59 AM #1
- Join Date
- Apr 2010
- Thanked 0 Times in 0 Posts
how to do external scripting?
I have a website of quite a few pages which also has a style sheet switcher so the user can select their own customised graphics and layout (css file)
these css files load in the graphics but only when the call is clicked... even if the page has already been opened for seconds or minutes when the graphics could have been loaded in for an instant switch.
so i implemented the following code:
it works fantastically - you open the page and as long as it takes to notice where you can click the styles is the same amount of time it takes to have the styles cached for the styles switch immediately and effortlessly.
however, the site has grown and is now quite a number of pages with the above in each html file. ive just added a "creative 2" style, which has caused the above to need updating........ the maintenance of this code is inefficient to edit each page.
would someone be able to point or show me how to, in principle:
<body onLoad="MM_preloadImages('/styles-code.js);"> styles-code.js?? page: '/corporate/heading.png', '/creative/heading.png', '/earth/heading.png', '/sea/heading.png', '/classical/heading.png', '/corporate/background.jpg', '/creative/background.jpg', '/earth/background.jpg', '/sea/background.jpg', '/classical/background.jpg', etc
would really appreciate guidance with this,
Last edited by secretfire; 09-08-2011 at 12:02 PM.
09-08-2011, 01:25 PM #2
- Join Date
- Apr 2003
- Bucharest, ROMANIA
- Thanked 379 Times in 375 Posts
Put this in the HEAD section of all your files: