| How to load JS code for future pages in advance?
|
stivare

msg:3975196 | 7:32 pm on Aug 19, 2009 (gmt 0) | Hi, I have three web pages that use javascript. page 1 - Very light in size with a basic form. Very little form validation and cookie setting JS code here. page 2 - Very high amount of JS code depending on cookies set and form fields on previous page. There can be a lot of user interaction. page 3 - Very high amount of JS code used to work with HTML and CSS. Now, since page-1 is very light in size, I want to download some of the JS code used on page-2, when user lands on page-1. I want to put it in browser cache and use it when user reaches page-2. Page-2 has a lot of interaction, and user is expected to be on this page for some time. I want to use this idle internet connection time to download the JS code for page-3. Is this possible to do? Thanks Su
|
whoisgregg

msg:3975208 | 7:47 pm on Aug 19, 2009 (gmt 0) | You can't do this with inline scripts, but you can do it if each one is it's own external javascript file. Just include the external scripts and make sure those files send the right caching headers. :)
|
stivare

msg:3975928 | 8:01 pm on Aug 20, 2009 (gmt 0) | Thanks.... That works Su
|
whoisgregg

msg:3976934 | 7:07 pm on Aug 22, 2009 (gmt 0) | No problem Su, glad it worked out for you. :)
|
|
|