如果html设置正确,则您的代码可以正常工作。这是我的测试html(使用php),因此您可以将其与自己的进行比较。
<?phpif (!empty($_POST)) { die("<pre>" . print_r($_POST, true) . "</pre>");}?><html><head> <title>ajax submit test</title><script type="text/javascript" src="jquery-1.3.2.min.js"></script><script type="text/javascript"> jQuery.noConflict(); jQuery(document).ready(function ($) { var $form = $('#default_contact'); $form.submit(function () { $.ajax({ type: 'POST', url: $form.attr('action'), data: $form.serialize(), success: function (response) { alert(response); } }); return false; }); });</script> </head><body> <form id="default_contact" action="formsubmit.php" method="post"> <input type="hidden" value="123" name="in1" /> <input type="hidden" value="456" name="in2" /> <input type="submit" value="send" /> </form></body></html>


