Reply to Re: Problem with preloading page in hidden div

Your name:

Reply:


Posted by Neredbojias on 06/23/06 22:30

To further the education of mankind, "Chris Tomlinson" <anon@anon.com>
vouchsafed:

>>> Great, would you kindly show us the correct format to use onload to
>>> preload an .htm page in its entirety.
>>>
>>> Much appreciated.
>>
>> There are several ways. (I assume you are familiar with the
>> javascript onload event: onload=somefunction.) The best and correct
>> way is to (pre) load just the _contents_ of the page, usually meaning
>> images. The text of an even fairly-lengthy page loads fast and is
>> normally considered negligable.
>
> Our big page is a bit of a unqiue entity in that it loads a few big
> images, and many more small ones. (This was the best way to achieve
> the ePosters in the shop windows, and have them automatically
> updatable.) There are also swf sounds, iframes, google map, etc.
>
> Therefore it is preferable to just preload the entire page, rather
> than specify all the seperate elements *of* that same page, so...

'Though you might say that.

>> Another way is to have the function called by the onload
>> event insert the future page url into the source of your iframe.
>
> Would you be kind enough to show us the correct code for this?
> Remember first though, it needs to solve the original problem of this
> thread, namely that our hidden div with the iframe containing the big
> page messes around with the cursor and form entry whilst it is
> preloading into the cache.

Hopefully, onloading will do that but it's something you'll have to try.

OTTOMH...

<iframe id="iffy"...

function petunia() {
document.getElementById('iffy').src="newpage.html";
}

onload=petunia;

....in the <body> section.

>> Another
>> way is to have the same function insert the future url into an
>> object.
>
> Again, would you be able to show us the correct code for this?
> Remember...
>:)

Same as iframe but using <object>.

>> Another way is to open an invisible window with the future page as
>> its source.
>
> I suspect this may be the best and least interfering option. I assume
> pop-up blockers don't mind this. Would you be able to show us the
> correct code for this? Remember first though... :D

Use the window.open function with the page to-be-loaded as url. Like...

var dupa=window.open('newpage.html,'gnupage','');

The j/s code within newpage.html should blur the page and make it
invisible if loaded via preload. This last can be done something like...

if (opener) document.body.style.visibility='hidden';

--
Neredbojias
Infinity has its limits.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация