js layui后端字符串json遍历

js layui后端字符串json遍历,html转文本

[{"sourceMoney":"50","money":"52"},{"sourceMoney":"100","money":"105"},{"sourceMoney":"200","money":"215"},{"sourceMoney":"300","money":"320"},{"sourceMoney":"500","money":"550"}]
, {field: 'contents', title: '内容', align: 'center', width: '660', templet: function (d) {
    //第一步,json转字符串
    var jsondatainfo = JSON.stringify(d.contents);
    //第二步,字符串双引号变单引号
    // jsondatainfo = htmlspecialchars(jsondatainfo);
    jsondatainfo = eval(eval(jsondatainfo));
    var str = '
'; for (let i = 0; i < jsondatainfo.length; i++) { str = str + '充'+ jsondatainfo[i].sourceMoney + '得

你可能感兴趣的:(前端,学习,javascript,layui,json)