Jump to content

Is there a script to open a small page when loading a large page?


bulgaria_mitko

Recommended Posts

the idea is a script that loads when a large page is trying to open that need for example 5-6 mins to load and in the mean time to open a very small page that is saying loading the page please wait and when the large page is loaded to go directly to that page. Do u get my idea? Thank you very much!

most browser display page content as it loads, you can put a message at the top of the page

 

if you want a page that loads with a loading message and nothing more, then displays the page when its done, you can use a little js and css at the end of the large page code to swap displaying blocks

 

ie

 

include both pages

 

block 1(visible):loading message

 

block 2(hidden):large page

 

end of large page: js swap display of blocks

 

the js wont load until large page has finished rendering

hey, enjaminbeazy,

 

im not very good in js, can u give me an example? what if the big page is http://movies.yahoo.com/ and the page that i want to display white page is rendering this text: loading message

 

how do u do that?  ???

dont use sleep. It has many problems. Just use a meta refresh...

 

<meta http-equiv="refresh" content="10; URL=pagetoredirectto.php">

 

content is where you place the seconds to wait. that one waits 10 seconds and send to "pagetoredirecto.php"

 

Snooble

the problem with those solutions are that they aren't accurate as to how long it takes to load the file

 

someone on a cable line will load it way faster than 56k and have to wait just as long

 

put this in head, im not too keen on javascript so i would make a 1x1 image at bottom of large file included to use onload event handler

 

<script type="text/javascript">
function change(id){
     ID = document.getElementById(id);
    
     if(ID.style.display == "")
          ID.style.display = "none";
     else
          ID.style.display = "";
      }
</script>

 

 

<div id="1">
Please wait while the page loads...
</div>

<div id="2" style="display:none">
include large file here

<img src="whatever" onLoad="change(1)">
<img src="whatever" onLoad="change(2)">
</div>

 

like i said, i don't know jack about javascript really so you can look up js event handlers and figure out how to combine the function calls and use a better loading schema

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.