首页 > 代码库 > submit提交表单

submit提交表单

<!DOCTYPE html>
<html>
<head>
<script src="http://www.mamicode.com/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#myForm").submit(function(){
var data = http://www.mamicode.com/$("#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="http://www.mamicode.com/提交"/>
</form>
</body>
</html>