Json value passing and ajax receiving, and jsonajax receiving
At the beginning, I started to enter the company and started to work on projects. Now a month has passed and I am getting more and more comfortable. Here is how to transfer the value of json to the front-end and receive the value from the front-end ajax, and write it down to myself and share it with you.
This is the interaction between two different types of json and ajax data (set and Class Object)
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 reception:
DataType: "json ",
Success: function (data ){
Var crmHtmlg = '';
$. Each (data, function (I, comment ){
CrmHtmlg + = '<tr>'
+ '<Td colspan = "2" style = "text-align: center; color: black; font-size: 18px; font-weight: bold;">' + comment. bbsTitle + '</td>'
+ '</Tr>'
});
Certificate ('{bowenchakan'{.html (crmHtmlg );