...

View Full Version : How often does an external script reload?



marilynn.fowler
11-11-2010, 08:58 PM
If multiple pages reference the same external JS sheet, does the sheet reload every time you go to a new page or does it stay in memory?

Philip M
11-11-2010, 09:01 PM
It is reloaded from the browser cache.

All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

Old Pedant
11-11-2010, 09:53 PM
Unless, of course, the user has set his/her browser to not us the cache. But that's so uncommon except maybe for people doing development that it's not worth worrying about.

marilynn.fowler
11-11-2010, 10:06 PM
To make sure I understand: if I have a variable and give it a new value from the homepage, that new value won't carry forward when I open another page. Is that correct?

glenngv
11-11-2010, 10:17 PM
All js variables/functions declared in a page (regardless if the script is an external js and cached by the browser) will be discarded when the page unloads.

marilynn.fowler
11-11-2010, 10:35 PM
Ah, ok. Got it. Thanks, you guys. I guess today I'll be learning about cookies.

Old Pedant
11-11-2010, 11:06 PM
Cookies or server side coding. Or...

But, yeah, probably cookies.

Philip M
11-12-2010, 10:42 AM
Cookies or server side coding. Or...

But, yeah, probably cookies.

Or use window.name, or a query string ......



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum