继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

form回调

慕工程3455409
关注TA
已关注
手记 318
粉丝 78
获赞 293


1、引用jQuery.js和jquery.form.js

jquery.form.js:http://malsup.github.io/jquery.form.js

2、html

<form id="form1" runat="server" class="layui-form" action="[接口连接]" target="rfFrame" method="post"><button id="submit"  type="submit">保存</button></form><iframe id="rfFrame" name="rfFrame" src="about:blank" style="display:none;"></iframe>


3、js

$("#submit").click(function () {var options = {url: '[接口连接]',   //同actiontype: 'post',dataType: 'json',//预计返回json数据beforeSend: function (xhr) {//请求之前},success: function (d) {debugger},complete: function (xhr) {//请求完成},error: function (xhr, status, msg) {}};$("#form1").ajaxSubmit(options);});


打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP