473,386 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

q - loading js file into cache

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
Sep 22 '06 #1
2 1492
aum
On Fri, 22 Sep 2006 16:27:12 +1200, aum wrote:
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
Sep 22 '06 #2
Yes you r right, Gmail is also doing such thing...

aum wrote:
On Fri, 22 Sep 2006 16:27:12 +1200, aum wrote:
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
Sep 22 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Adrian MacNair | last post by:
Hi, I created an image gallery which displays 63 images in a slideshow. The problem is that the show was slow because each image loaded one at a time during the show. No problem right? I just...
76
by: kwilder | last post by:
This works, but it doesn't load the latest version of the xml if it was just modified without closing and reopening the browser. Here's the scenario: I have an xml doc called results.xml. It...
2
by: Jean Pierre Daviau | last post by:
When I have something like this in a js file. listeImg = new Array(); listeImg = new Image(w,h); listeImg.src = "centre1.jpg"; etc Are the images loaded after the page is loaded? In the same...
6
by: ImOk | last post by:
I am using Windows IIS with PHP5 CGI. When I want to use an extension in PHP5 under Windows I enable the extension line in PHP.INI. (e.g. extension=php_sqlite.dll). Does PHP load all the...
4
by: max | last post by:
Hello, Based on various posts, I've come up with the following code to load data into a js array dynamically without a screen refresh. It works, but you have to push the button twice before it...
6
by: Venkatesh | last post by:
Hello All, I have couple of doubts regarding the concept of on-demand javascript loading using javascript code. I could see on the net different techniques for achieving this - techniques like:...
6
by: ernesto.tejeda | last post by:
Hello, I have a couple of questions regarding the loading of .js files for the browser and would like anyone to point me wher to find the answer (or if you know the answer and tell me will do just...
5
by: =?Utf-8?B?V2FubmFiZQ==?= | last post by:
We have a page that is loading very slow. There is not a lot of data, not a lot of users are connected at the same time and the page does not produce an error, so I am not sure where to start to...
3
by: suresh_nsnguys | last post by:
Respected sir/madam, right now i am displaying movie (.wmv) file using <embed> and <object> tags inside <div> tag. Everything is working fine. ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.