1

I have this code that will call a page to a div when the radio button is selected, but sometimes, it takes 4 or 5 secounds to load, because it as a big query...

有没有办法在 div 加载内容时发出加载信号?谢谢 :)

   $('#button-radio-1').change(function(){
                var valor = $(this).val(); 
                $.post('mostrar_whois.php',{valor: valor}, function(data){
                $('#pesquisa').html(data)
                });
            });
4

1 回答 1

2

You can try add a "spinner" img to your div, and remove it as soon as the post action is complete. Like this:

$('#button-radio-1').change(function(){
                var valor = $(this).val();
                $('#pesquisa').html('<img src="spinner.gif" />');
                $.post('mostrar_whois.php',{valor: valor}, function(data){
                $('#pesquisa').html(data);
                });
            });
于 2012-08-07T12:03:33.370 回答