ajax调用卡在beforsend函数上

时间:2014-02-01 12:16:04

标签: jquery ajax

    $(document).ready(function(){   


$('.gbutton').click(function(){

    text=$("#textid").val();

    $.ajax({

        type: "POST",
        url : "postquery.php",
        data: "text="+text,

        beforeSend: function(){
            $('#loading').show();
        }

        success: function(html)
        {

            $('#new_query_post').html(html);
        }



    });

});

        });

此代码在没有beforeSend函数的情况下正常工作,但在添加beforeSend函数时完全停止..

1 个答案:

答案 0 :(得分:1)

,

之后遗失beforeSend
beforeSend: function(){
    $('#loading').show();
},  /*
 ^  */
success: function(html){
    $('#new_query_post').html(html);
}