加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ajaxForm和ajaxSubmit 粘贴就可用

发布时间:2020-12-16 00:41:52 所属栏目:百科 来源:网络整理
导读:!-- 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 scri
<!-- 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>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读