有人能告诉我为什么这段代码不起作用吗?
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script>
$(function () {
$('form').bind('submit', function () {
$.ajax({
type: 'post',
url: 'post.php',
data: $('form').serialize(),
success: function () {
alert('form was submitted');
}
});
return false;
});
});
</script>
</head>
<body>
<form>
<input name="time" value="00:00:00.00"><br>
<input name="date" value="0000-00-00"><br>
<input name="submit" type="button" value="Submit">
</form>
</body>
</html>
当我按下按钮时,什么也没发生.在接收的php文件中,我使用$_POST['time']和$_POST['date']将数据放入mysql查询中,但它没有得到数据.有什么建议吗?我想这和提交按钮有关,但我想不出来