submit提交表单

<!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>

上一篇:jQuery对表单元素的取值和赋值操作代码(转)


下一篇:读python源码--对象模型