我有这样一个表格:
<form id="new-application" method="post" enctype="multipart/form-data" data-remote="true" action="/inv/claims?locale=uk" accept-charset="UTF-8">
<a rel="nofollow" data-remote="true" data-method="delete" data-confirm="Are You sure?" href="/inv/claims/1?locale=uk">delete</a>
<a rel="nofollow" data-remote="true" data-method="delete" data-confirm="Are You sure?" href="/inv/claims/2?locale=uk">delete</a>
</form>
我在 my.js 中也有这样的代码行:
var toggleLoading = function() { $("#ajax-loader").toggle() };
$("#new-application")
.bind("ajax:loading", alert('loading'))
.bind("ajax:complete", alert('complete'))
.bind("ajax:success", function(event, data, status, xhr) {
alert('succ');
});
当我点击删除时,我只收到一条消息succ但我正在等待一条消息加载,然后是一条消息succ。
为什么我在成功之前没有收到消息加载?