我有提交一个表单到MVC控制器如下功能 -jQuery的执行顺序
function submitForm() {
$.ajax
({
type: 'POST',
url: '/Users/Index',
data: $('#searchForm').serialize(),
beforeSend: function() {
$('.usersearchresult').fadeOut('fast', function() { $('.loadinggif').show(); });
},
success: function (response) {
$('.loadinggif').hide();
$('.usersearchresult').hide().html(response).fadeIn('normal');
}
});
return false;
}
此工作正常时,响应返回太快$('.loadinggif').hide();
发生后$('.usersearchresult').hide().html(response).fadeIn('normal');
我除了尝试回拨功能的不同组合($('.loadinggif').hide();
回拨时拨打$('.usersearchresult').hide().html(response).fadeIn('normal');
,甚至相反,行为总是相同的)
我是jquery的新手;任何帮助将不胜感激!
这很整洁!这是问题所在。谢谢! – americanslon