更新时间:2022-12-11 13:48:36
很可能您正在使用 button
或 submit
来触发 ajax 事件.试试这个:
It's most likely that you're using a button
or submit
to trigger the ajax event. Try this:
$('#exportForm').submit(function(e){
e.preventDefault();
$.ajax({
type: "POST",
url: $(this).attr( 'action' ),
data: $(this).serialize(),
success: function( response ) {
console.log( response );
}
});
return false;
});