ajaxForm和ajaxSubmit 粘贴就可用示例代码

人生不过三万天,成功失败均坦然,是非恩怨莫在意,健康快乐最值钱。你的爱好就是你的方向,你的兴趣就是你的资本。
 
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="jquery-1.7.2.min.js"></script>
<script src="jquery.form.js"></script>
<script>
//ajaxForm
var optionss = {
dataType:"text",
type:'post',
url: "chuli.php",
beforeSubmit:showRequest,
success:showResponse,
clearForm:true
};
$('#form1').ajaxForm(optionss);
function showRequest() { }
function showResponse(data){
alert(data);
}
</script>
</head>
<body>
<form action="chuli.php" method="post" id="form1">
<input type="text" name="name" />
<input type="text" name="sex" />
<input type="submit" value="提交"/>
</form>
<hr />
<form action="chuli.php" method="post" id="form2">
<input type="text" name="name" />
<input type="text" name="sex" />
<input type="button" id="tijiao" value="提交"/>
</form>
</body>
<script>
//ajaxSubmit
$("#tijiao").click(function(){
$("#form2").ajaxSubmit({
success:function(data){
alert(data);
}
})
});
</script>
</html>

本文ajaxForm和ajaxSubmit 粘贴就可用示例代码到此结束。身边的朋友都在往前走,离我越来越远,我却一直站在原地不动。不进则退!我竟然才明白这个道理,原来拉开距离的并不是她们,而是我。小编再次感谢大家对我们的支持!

标签: ajaxForm ajaxSubmit