q - loading js file into cache

A

aum

Hi,

What's the simplest way to fetch a js file from the current website, then
cache it?

I'm using dojo, which has a large js file when using the built version.
As a mercy for dialup users, I want to serve up a tiny 'loader' html page
(containing an animated 'loading...' gif) which, when loaded:

1. retrieves the big js file, and plants it in the cache
2. when the js file is retrieved, then sets document.location to
the url of the real website page which uses this js file, and
thus redirects to that page

Cheers
aum
 
A

aum

What's the simplest way to fetch a js file from the current website, then
cache it?

Seems I've answered my own question.

What's working for me is to insert, just before the final </html>
at the end, the lines:

<script type="text/javascript" src="path/to/big/js/file.js"></script>
<script type="text/javascript">
document.location = "next-page.html";
</script>

Cheers
aum
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top