If pre loader fails to load content
<p>We fetch some image data from Picasa, using yoxview and whilst the data is being fetched, which are image thumbnails.</p>

<p>We display a preloader image.</p>

<p>Now, the data is fetched dynamically, and at times the fetch url we are requesting parses no results. So the Image preloader for the div, keeps whirring away .. basically because the data has failed to load.</p>

<p>So my question is this, if no result is found within say 5 seconds, whilst the preloader is being displayed, can we initiate a timeout, and display a placeholder image overlaying the preloader, with say message .. unable to fetch feed content at this time ??</p>

<p>Our code is like this:</p>

<pre><code>$(document).ready(function(){
    $("#yoxview_picasa").yoxview({ 
        dataUrl: 'http://picasaweb.google.com/lh/view?q=&lt;?=$randomResult["suburb"];?&gt;+&lt;?=$randomResult["state"];?&gt;',
        dataSourceOptions: {
            "max-results": 21,
                imgmax: 800
                },
                onLoadBegin:function(){
                $('.imagecontainerburbs').hide();
                $('&lt;div class="loading" style="width: 580px; height: 250px;position:relative;margin-top:100px;margin-bottom:-250px;"&gt;&lt;center&gt;&lt;img src="http://www.pathToPreloaderImage.com/css/images/422.gif" alt="loading"/&gt;&lt;br /&gt;&lt;/center&gt;&lt;/div&gt;').insertAfter('.imagecontainerburbs');
                },
                onLoadComplete:function(){
                $('.loading').remove();
                $('.imagecontainerburbs').find("img").css({'width':'64px','height':'64px'});
                $('.imagecontainerburbs').find("img").createLoader();
                $('.imagecontainerburbs').fadeIn();
                }
            });
        });
</code></pre>

<p>As you can see, we use a nifty piece of php to propagate the data url, from our database.</p>

<p>Essentially the data is fetched like this.</p>

<p>url : picasa.google.com/lh/view? and we apend the query  suburb and state to the url.</p>

<p>So if when we ping picasa for a random result, and it has no results .. currently the loader animation continuously displays, what I need to do is if no data is fetched, initiate a placeholder that states, Unable to Fetch Data at this time or whatever.</p>

<p>Any suggestions?</p>

<hr>

<p><em><strong>Edit/Update</em></strong>
Given the suggestion below, should I add my code like this?</p>

<pre><code>onLoadBegin:function(){
    timer = setTimeout(function() {
     // get no data in 20 seconds perform something
    $('&lt;img src="http://path to image file.com/placeholder.png"&gt;'),
},20*1000);
</code></pre>
