json的前后台解析转换
1、java解析json4中方式:
(1)json-lib
(2)Jackson
(3)Gson
(4)FastJson
2、js(浏览器支持的转换方式(Firefox,chrome,opera,safari,ie9,ie8)等浏览器:)
JSON.parse(jsonstr);//可以将json字符串转换成json对象
JSON.stringify(jsonobj);//可以将json对象转换成json字符串
3、jquery
$.ajax({
type:"POST",
data:{"templateId":templateId},
dataType:"json",
url:"/msip_dj/template/editTemplateLayout",
success:function(data){
if(null!=data){
$(".demo").html(decodeURIComponent(data.templateEditStr).replace(/\+/g,'').replace(/\\/g,'\\\\'));
}
}
});
tempTemplateEditStr=URLEncoder.encode(template.getTemplateEditStr(),"UTF-8");
相关推荐
sailxu00 2020-07-28
newthon 2020-05-13
adonislu 2020-01-18
牧场SZShepherd 2020-01-04
qianqianxiao 2019-11-04
翟浩浩Android 2013-01-13
张树刚 2019-07-16
sjunothing 2013-06-29
ghjcduhvfyjhbf 2013-02-27
Dolphinsz 2011-09-16
大树 2016-09-19
yinge00 2016-04-09
Anything 2015-09-07
somebodyoneday 2012-09-24
csuhanshuai 2012-02-22
Urchindong 2012-02-06
ztgreenleaves 2012-01-10
大树 2011-10-24