Используйте
ajaxStart ()
и
ajaxComplete ()
функции, чтобы показать и скрыть загрузочный GIF.
$("#loading").ajaxStart(function(){
$(this).show();
});
$("#loading").ajaxComplete(function(){
$(this).hide();
});
Пока div или элемент с идентификатором
загрузка
имеет загрузочный GIF.
Ваш окончательный код должен выглядеть следующим образом:
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$("#dvloader").show();
oTable = $('#example').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers"
});
});
(document).ready(function() {
$("#btnround").click(function() {
$.ajax({
url: "ajax_request.php",
cache: false,
async: true,
data: "shape=ROUND",
success: function(html) {
$(".demo_jui").html(html);
}
});
});
$("#loading").ajaxStart(function(){
$(this).show();
});
$("#loading").ajaxComplete(function(){
$(this).hide();
});
});
</script>