Delayed load regions can improve the server processing time of a page.
It works by ignoring the contents of this tag in the initial page load.
The contents are then loaded via a second AJAX request after everything else.
The main use case is to make secure server-side API requests without affecting performance.
For instance: loading data from an external feed, then presenting it in a repeater.
The AJAX request and this library's code makes the total download size of your page larger, so use of this control is recommended only to defer server processing time.
Content
any
The content to load later.
Attributes
id
string
(Required) Give this control a unique id. Can be accessed in the client DOM (eg, document.getElementById('myid') or in the server DOM using [? $myid ?] or [? $('myid') ?]).
Examples
Currency Feed
Pulls a JSON currency feed and displays the results
Demonstrates a long running operation through calling PHP's sleep() function.
HTML:
<p>This content loads first.</p>
<ajax:delayedload id="delayedload_region">
<div>
[? someLongRunningProcess() ?]
<p>Before this content which took 3 seconds to process on the server.</p>
</div>
</ajax:delayedload>
<p>This content also loads first.</p>
<p><a href="#" onclick="window.location.reload(); return false;">Refresh example.</a></p>
PHP:
<?php
function someLongRunningProcess()
{
sleep(3);
}
?>