Zen Cart Logo
Forums / General Questions / Sideboxes Re-load for each page transition...

Sideboxes Re-load for each page transition...

Locked

Views: 1,303

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
30 Jul 2008, 3:09 PM
#1
rainthebat avatar

rainthebat

Zen Follower

Join Date:
Feb 2007
Posts:
314
Plugin Contributions:
0

Sideboxes Re-load for each page transition...

Since I'm using javascript to round the corners of the sideboxes, I don't want the script to re-load on every page change.

The script is over 25k, so always being loaded every page is undesirable.

The javascript is located in the jscript folder in the My_template directory and is correctly named.

Is there any way that this script could load just once instead of loading on every page???

The website is fabstash.com

Many Thank Yous.

30 Jul 2008, 3:19 PM
#2
bigbadboy avatar

bigbadboy

Totally Zenned

Join Date:
Apr 2008
Location:
London
Posts:
557
Plugin Contributions:
0

Re: Sideboxes Re-load for each page transition...

Why are you using a 25k script for something so small? Images would weigh less than that.

30 Jul 2008, 7:19 PM
#3
rainthebat avatar

rainthebat

Zen Follower

Join Date:
Feb 2007
Posts:
314
Plugin Contributions:
0

Re: Sideboxes Re-load for each page transition...

true. I'm not sure I know how to go about making the images though, that is something that has stumped me in the past.

these javascript sideboxes are pretty cool too, they allow for a complete image or gradient fill of your box. Lots of potential for cool things with that! So you can see why I would attempt to keep the boxes first.

30 Jul 2008, 8:18 PM
#4
rainthebat avatar

rainthebat

Zen Follower

Join Date:
Feb 2007
Posts:
314
Plugin Contributions:
0

Re: Sideboxes Re-load for each page transition...

I guess the point is that if I can have the 25k javascript loading once, I would be using a cool script that outdoes rounded corners with just css and is worth its weight so to speak.

3 Aug 2008, 2:19 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Sideboxes Re-load for each page transition...

If the javascript is in a .js file on the filesystem and is being loaded in a src= parameter of a <script> tag, then the browser should already be caching it and therefore only actually downloading the .js file when the cache expires or on the first visit to the site ... not every page.

3 Aug 2008, 8:29 PM
#6
rainthebat avatar

rainthebat

Zen Follower

Join Date:
Feb 2007
Posts:
314
Plugin Contributions:
0

Re: Sideboxes Re-load for each page transition...

DrByte:

If the javascript is in a .js file on the filesystem and is being loaded in a src= parameter of a <script> tag, then the browser should already be caching it and therefore only actually downloading the .js file when the cache expires or on the first visit to the site ... not every page.

o.k. The browser may not be reloading the script on each page transition, but it is redrawing the corners for the sideboxes with each page transition. I guess visually, since the corners are the last thing to load on the page, it would be nice to have them load first. Any ideas, or is this not something that can be (or is worth it) done?

~Rain