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>
相关推荐
TONIYH 2020-02-20
wuxhyou 2015-04-11
adgjlxxx 2016-12-23
RanQi0 2016-04-21
wcqwcq 2016-12-23
sunnyishere 2015-12-21
mmywcoco 2015-11-23
dalong 2015-11-21
shumark 2015-11-19
liyifan 2015-04-11
roodyszz0 2014-03-06
lpch0 2013-01-05
longshengguoji 2012-12-26
欧阳凯少 2012-11-16
hugebait 2012-11-14
清闲居 2019-06-20
lpch0 2012-05-29
sunnyishere 2012-05-29
WillZhang 2011-10-24