/**
* 表单提交
* @param formId
* @param submitForm_success
* @return
*/
function submitForm(formId,submitForm_success){
layui.use(‘form‘, function(){
var form = layui.form;
//监听提交 ajaxSubmit.js支持
form.on(‘submit(formSubmit)‘, function(data){
$(formId).ajaxSubmit({
type:‘post‘,
success:submitForm_success
});
return false;
});
});
}
submitForm("#addform",function(data){
data = JSON.parse(data);
parent.layer.msg(data.msg);
if(data.result=="success"){
parent.loadCount();
closeIframe();
}
});
原文地址:https://www.cnblogs.com/java-llp/p/11393549.html
时间: 2024-10-17 08:33:05