如何从后台发送list数据,前台js如何接收?

qq_35281225 qq_35281225 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

$(function(){
$("#myform").validate({
debug : true, // 取消表单的提交操作
submitHandler : function(form) {
form.submit(); // 提交表单
},
errorPlacement : function(error, element) {
$("#" + $(element).attr("id").replace(".", "\\.") + "Msg").append(error);
},
highlight : function(element, errorClass) {
$(element).fadeOut(1,function() {
$(element).fadeIn(1, function() {
$("#" + $(element).attr("id").replace(".","\\.") + "Div").attr("class","form-group has-error");
});

})
},
unhighlight : function(element, errorClass) {
$(element).fadeOut(1,function() {
$(element).fadeIn(1,function() {
$("#" + $(element).attr("id").replace(".","\\.") + "Div").attr("class","form-group has-success");
});
})
},
errorClass : "text-danger",
rules : {
"eid" : {
required : true
//remote : {
// url : "check.jsp", // 后台处理程序
// type : "post", // 数据发送方式
// dataType : "html", // 接受数据格式
// data : { // 要传递的数据
// code : function() {
// return $("#code").val();
// }
// },
// dataFilter : function(data, type) {
// if (data.trim() == "true")
// return true;
// else
// return false;
// }
//}
} ,
"password" : {
required : true
},
"ename" : {
required : true
} ,
"phone" : {
required : true
},
"jid" : {
required : true
},
"did" : {
required : true
},
"salary" : {
required : true ,
number : true
},
"pic" : {
required : true ,
accept : ["jpg","png","gif","bmp"]
},
"note" : {
required : true
}
}
});
})


这是前台js页面,后台的话是一个List集合返回所有的数据,我的问题就是:如何在前台js页面接收后台的List集合,如何发送,如何接收,是用json吗?后台接收可以用jquery吗?麻烦写下示例,有思路,但不会写

我想实现的是如果雇员姓名重复,则显示“雇员已存在,请更换名字”
...全文

相关推荐

评论 6
收藏 已收藏
分享
返回顶部
qq_35281225
Web 开发 81,108 成员 341,721 内容