You create a containing div with a loading gif in the center of it.
When you start your ajax request you show it (with jquery for example) when the ajax request is done you hide it.
It could/should look something like this :
Code to show the loading indicator :
$('#busy-holder').show();
div :
<div id="busy-holder" style="display: none">
<div id="busy">
</div>
</div>
css :
#busy
{
position: fixed;
left: 50%;
top: 50%;
background: transparent url("loader.gif");
z-index: 1000;
height: 66px;
width: 66px;
}
#busy-holder
{
height:100%;
width:100%;
position:fixed;
left:0;
top:0;
display: none;
filter: alpha(opacity=30);
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=30);
opacity:0.3;
-moz-opacity: 0.30;
z-index: 1000;
}