我想处理来自下面提交的成功调用并重新加载当前页面。我怎样才能最好地做到这一点?
$('#modal-confirm').click(function() {
$(form).ajaxSubmit();
$(form).resetForm();
$('#myModal').modal('toggle');
});
我想处理来自下面提交的成功调用并重新加载当前页面。我怎样才能最好地做到这一点?
$('#modal-confirm').click(function() {
$(form).ajaxSubmit();
$(form).resetForm();
$('#myModal').modal('toggle');
});
您可以将选项传递给ajaxSubmit()
$(form).ajaxSubmit({
success:function(){
alert("complete");
// do other stuff
}
});
你也许可以试试这个..
$('#modal-confirm').on("click", function(e){
e.preventDefault();
$.ajax({
url : '...'
}).done(function(data) {
//handle your conditions here once the request is successful. if conditions are met, then...
location.reload(true);
});
});
$(document).ajaxSuccess(function() { // http://api.jquery.com/ajaxSuccess/
location.realod();
})
$('#modal-confirm').click(function() {
$(form).ajaxSubmit();
$(form).resetForm();
$('#myModalOne').modal('toggle');
});