|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I want a JavaScript (or a cookie, php, cgi - whatever) to do this for me:
1. When users load 'index.html' into their browsers I want this to happen: 1.1 A script of some kind should preload documents 'main.html' and 'settings.html'. Furthermore I would like the script not only to load those documents but also loading those documents' contents (sush as images and javascripts). However, preloading those files contents isn't 100% necessary... 1.2 When done preloading those documents, I'd like 'index.html' to be replaced with 'default.html' 1.3 (Optional) It would be a nice effect if 'index.html' contains a graphic bar which shows how many % the user has downloaded. That's it. Note: I don't want to make a "false preload-thing" using frames or divs. Replies to this request should contain proper scripting and direct answers to my Q. Thanks, Joel Viksten www.MAGiQ.net info@magiq.net |
|
#2
|
|||
|
|||
|
In response to your question:
I beleive you could do it best with javascript or perl if you know either one of those languages, I know perl but i'm not going to sit here and type out all of the code for you. To point you in the right direction with perl what you might want to do to acclompish your goal is the following: Have some sort of perl script run when the initial page is loading (ssi perhaps) and retreive all of the other pages and images you wish to load. Getting them into the users cache is a different story though as I am not too sure how you would do so with perl, thats where java would come in I beleive. Hope that got you thinking the right way. Another pointer: with perl don't ask for people to write your code for you, rtfm later |
|
#3
|
|||
|
|||
|
Thanks for your reply,
As you wrote, it's hard to get the pages into the users' cache. And that's exactly what I want... I've tried to solve this with several different techniques but I haven't succeeded yet. That's why I posted this Q here at the Perl-section. I DO KNOW that asking for code is rude. However, I believe that if there is a way to solve my problem. the scripting wouldn't be longer than 5-10 rows. And I do believe that isn't much to ask. Is it? If you guys asked me a Q and I knew the A, I would definitly take time to write 5 rows of code........ At last: I do know some languages. However JavaScript and Perl is what I don't know that well. But I'm very familiar to C++ and Java but that doesn't help me now, does it? Thanks again. |
|
#4
|
||||
|
||||
|
Hi!
As far as I know, you have to load pages (to get them into the browser's cache) for example by calling them from an (invisible) iframe at the bottom of the page or something. Also add an onLoad= event handler to your initial page's opening <body> tag. After the whole page (including all the iframes, etc) is loaded, the onLoad expression is evaluated which you could use to transfer the user one page further (location.href=...). Reaching the second page the browser will happily find out that all the stuff is already in its caches since that stuff has been downloaded only recently (on the preceding page). No, I don't think there is a way without frames, iframes, zero img tags and so on.... the only thing that I know can be gracefully preloaded (by JS that is) is imges. This works by simply adding a JS part to page number one that names all the pics and pic.src="...". They are called then but not shown. Greetings, Atrus. |
|
#5
|
|||
|
|||
|
Solved
Based on what Altrus said I've come up with a great solution.
I let NN4 users preload the page in a <LAYER src> and IE4 and above plus NN5 use IFRAMEs. Thanks for you help Altrus! Love, Joel |
|
#6
|
|||
|
|||
|
Names
Sorry ATRUS,
of course that's the correct spelling of your name ![]() |
|
#7
|
||||
|
||||
|
thx
![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > Preloading pure html-documents |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|