Delayed content loading

I used this technique on the ipoteka.kz. There's an actual content and relatively "heavy" additional imagery (e.g. the houses at the top).

Additional content, or decorations, can be loaded after the basic content is displayed by "including" an external file with an AJAX call.

Attaching the additional content loading to a window.onload event, lets visitor start the basic content sooner. Inserting HTML from another file, makes separating the markup easy and accessible for a designer.

Prototype javascript library used here.

Note the Event.observe construct; it's the "right" thing to avoid window.onload conflict.


<script src="javascripts/prototype.js" type="text/javascript"></script>

<div id="delayed-content"></div>

<script type="text/javascript">
Event.observe(window,'load',function(){
	new Ajax.Updater('delayed-content','delayed-content.html');
});
</script>

photo is a part of the Alpha Orionis and does freelance too.

I recommend

Freakonomics Getting Things Done Getting Real Steve Krug: Don't make me think

I'm using

Mac Coda RoR

Hosting is kindly provided by