I have a small ajax jquery script that returns XML to me. While it works and communicates with the server, I show the animation of the bootloader.
The problem is that I do not see the animation. Either I did something wrong, or the network connection is really fast.
Does anyone know how I can imagine a delay for my ajax code to slow down the process and I can check the animation function?
Thank.
ps: given ajax code, just incase
function fetchData($nodeid, $area){
if( $nodeid != $currentRoomId ){
popupBox($area);
}
var $nid, $title, $classroom, $boardroom, $cabaret;
$.ajax({
url: "/room/" + $nodeid + "/rss.xml",
dataType: "xml",
success: function($xml){
$returnXML = $xml;
$($xml).find('node > *').each(
function(){
switch( $(this).attr('name') ){
case 'Nid':
$nid = $(this).text();
break;
case 'Title':
$title = $(this).text();
break;
case 'Classroom':
$classroom = $(this).text();
break;
case 'Boardroom':
$boardroom = $(this).text();
break;
case 'Cabaret':
$cabaret = $(this).text();
break;
case 'Theatre':
$theatre = $(this).text();
break;
case 'Notes':
$notes = $(this).text();
break;
default:
break;
}
}
);
$roomInfo = new Array();
$roomInfo.push('Title', $title);
$roomInfo.push('Classroom', $classroom);
$roomInfo.push('Boardroom', $boardroom);
$roomInfo.push('Cabaret', $cabaret);
$roomInfo.push('Theatre', $theatre);
$roomInfo.push('Notes', $notes);
highlightRow($nid);
popupBox($area, $roomInfo);
},
statusCode: {
200: function(){
}
},
error: function(){
},
complete: function(){
}
});
}
sisko source
share