Facebook apps and animated Gif downloads

I am working on developing a facebook application and am in a small snag. When calling ajax, I want to tell the user that the application is loading.

My confusion is that others say that facebook does not allow animated gifs, however the above application has animated gifs. I combed their source code to no avail. Any thoughts on how to make animated gifs play in the facebook app would be great.

<script type="text/javascript">
function search_ajax()
{
    document.getElementById('loading').setStyle('display', 'block');
    var ajax = new Ajax();
    ajax.responseType = Ajax.FBML;
    ajax.ondone = function(data) {
        document.getElementById('search_results').setInnerFBML(data);
        document.getElementById('loading').setStyle('display', 'none');
    }
    var queryParams = { "VSearchMake" : document.getElementById('VSearchMake').getValue(),
    "VSearchModel" : document.getElementById('VSearchModel').getValue(),
    "VSearchYear" : document.getElementById('VSearchYear').getValue(),
    "VSearchPrice" : document.getElementById('VSearchPrice').getValue(),
    "ShowNewUsed" : document.getElementById('ShowNewUsed').getValue()   };
    ajax.post('http://domainname/facebook/results.cfm', queryParams);
}

</script>

<img src="http://domainname/images/loading.gif" id="loading" style="display:none;" />
+3
source share
2 answers

? , gif, JavaScript . , , JS API Facebook. , , , , .

+1

gifs . gif :

<img src="http://example.com/images/mygif.gif" style="display:none;" id="wait">

ajax, :

document.getElementById('wait').setStyle('display', 'block');

ajax, :

document.getElementById('wait').setStyle('display', 'none');

Update:

, :

ajax.ondone = function(data) {
    document.getElementById('search_results').setInnerFBML(data);
    document.getElementById('loading').setStyle('display', 'none');
}
+1

Source: https://habr.com/ru/post/1757999/


All Articles