jquery.form.js如何避免多次提交
今天遇到這個問題,上網找半天,沒思路,上官網看了http://www.malsup.com/jquery/form/#ajaxForm,也沒路子,再看看網絡別人的文章,倒是找到一個辦法,其實也很簡單。
//pre-submit callback
function showRequest(formData, jqForm, options) {
$('#button').attr('disabled',"true");
return true;
}
function showResponse(data, statusText, xhr, $form) {
$('#button').removeAttr("disabled");
}
在兩個回到函數中,加上控制。