Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 27th, 2001, 03:52 PM
magiq magiq is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 14 magiq User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Preloading pure html-documents

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

Reply With Quote
  #2  
Old May 27th, 2001, 07:06 PM
dkode dkode is offline
PHP/PERL/.NET Coder
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Daytona Beach, Florida
Posts: 36 dkode User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 41 sec
Reputation Power: 8
Send a message via AIM to dkode
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

Reply With Quote
  #3  
Old May 28th, 2001, 06:11 PM
magiq magiq is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 14 magiq User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking Skills

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.

Reply With Quote
  #4  
Old May 28th, 2001, 06:32 PM
Atrus's Avatar
Atrus Atrus is offline
yet another member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 262 Atrus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
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.

Reply With Quote
  #5  
Old May 29th, 2001, 07:16 AM
magiq magiq is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 14 magiq User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #6  
Old May 29th, 2001, 07:17 AM
magiq magiq is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 14 magiq User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Names

Sorry ATRUS,

of course that's the correct spelling of your name

Reply With Quote
  #7  
Old May 29th, 2001, 08:29 AM
Atrus's Avatar
Atrus Atrus is offline
yet another member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 262 Atrus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
thx

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Preloading pure html-documents


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT