导航

submit提交表单

Posted on 2014-06-13 18:26  网名还没想好  阅读(276)  评论(0编辑  收藏  举报

<!DOCTYPE html>
<html>
<head>
<script src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#myForm").submit(function(){
var data = $("#myForm").serialize();
var url = "1.php";
$.ajax({
url:url,
type:"GET",
data:data,
success:function(msg){
alert(msg);
}
});
return false;
});
});
</script>
</head>
<body>
<form id="myForm" action="" method="post">
Name: <input type="text" name="name" />
Comment: <input name="comment"></input>
<input class="button_nomal" id="submit_input" type="submit" value="提交"/>
</form>
</body>
</html>