您好,欢迎访问一九零五行业门户网

json传值以及ajax接收_html/css_WEB-ITnose

一开始进入公司,做起项目来比较不知所措,现在一个月过去了,越来越得心应手,下面是json向前端传值以及前端ajax接收,给自己记下也分享给大家。
这是两个类型不同的json与ajax的数据交互(集合、类对象)
jsonconfig jsonconfig = new jsonconfig(); //lenient
jsonconfig.setcycledetectionstrategy(cycledetectionstrategy.lenient);
jsonarray json = jsonarray.fromobject(listpm, jsonconfig);
outjsondata(json);
blog b=(blog) bgdao.findblog(integer.parseint(id));
b.setbbscenterstr( new string(b.getbbscenter()));
jsonarray json = jsonarray.fromobject(b);
outjsondata(json);
ajax接收:
datatype:json,
success: function(data) {
var crmhtmlg = '';
$.each(data,function(i,comment){
crmhtmlg+='
'
+''+comment.bbstitle+' '
+'
'
});
$('#bowenchakan').html(crmhtmlg);
其它类似信息

推荐信息