如何在等待来自ajax的回调时发送消息

时间:2015-04-25 15:51:12

标签: jquery ajax

我想在PHP帖子处理数据的同时插入一个图像working.gif ..现在它只是在返回数据之前什么也没做。有时在数据之前有10-15秒的处理时间返回所以某种指示告诉用户等待将是伟大的。让我们使用working.gif图像作为指标。

感谢有关如何将上述内容纳入以下代码的帮助:

$.ajax({
    type: "POST",
    url: "post.php",
    data: dataString,

    //if received a response from the server
    success: function (response) {

        $('#ajaxResponse').html('<pre>' + response + '</pre>');

0 个答案:

没有答案