提交表单而不刷新页面ajax,php,javascript?

提交表单而不刷新页面ajax,php,javascript?,第1张

提交表单而不刷新页面ajax,php,javascript?

解决了它只是替换了:

$('#msg_form').submit(function (e) {    e.preventDefault();$.ajax({  type: 'post',url: 'mailer.php',data: $('#msg_form').serialize(),success: function () { alert('form was submitted');}    });    return false;});

用这个代替

$.post('mailer.php', $('#msg_form').serialize())


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5013403.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-11-14
下一篇2022-11-14

发表评论

登录后才能评论

评论列表(0条)

    保存