我是这样做的,但是您可以使用submit handler并执行如下操作:
$('#yourFormButton').click(function(e) { e.PreventDefault() }
“提交”按钮的默认操作是提交表单,因此需要停止该操作。
另一种选择和我使用的方式是,表单上的按钮应为“button”类型,而不是“submit”,然后使用以下选项:
$('#yourFormButton').click(function()
{
var conf = confirm("you are sent the message to<?php echo $count; ?>customer, Do you want to send?");
if(conf){
$('#mess').submit();
}
});