我有提交一個表單到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