返回的数据

xiaoxiao2021-02-27  374

$.ajax({ type: 'GET', url: "data/problem" + indexr + ".json", dataType: 'json', success: function (ret) { if (ret && ret.code == 0) { var arr = ret.data; $('.qna_box').html("") //之前的数据的清空 for(var i=0;i<arr.length;i++){ var obj = arr[i]; var tem= $("<div class='qna_col'><h3 class='qna_title'>"+obj.firstName+"</h3><div class='qna_desc c_txt2' style='display: block'><div class='qna_parm'></div><div class='qna_two'></div></div>") $('.qna_box').append(tem); myObject=obj; showInfo(obj,tem) showInin(obj,tem) } onClick() } function showInfo(obj,tem) { var arr = myObject.list1; if(obj.firstName == "用银行卡还款,有支付限额吗?"){ for (var i = 0; i < arr.length; i++) { var htmltype= $("<span class='bospan' style='border-bottom:1px solid #333333;border-left:1px solid #333333;width: 200px;height: 30px;display: inline-block;text-align: center;line-height: 30px;'>"+arr[i]+"</span>") tem.find('.qna_parm').append(htmltype) } }else { for (var i = 0; i < arr.length; i++) { var htmltype= $("<p>"+arr[i]+"</p>") tem.find('.qna_parm').append(htmltype) } } $('.bospan:nth-child(3n)').addClass('add') $('.bospan:nth-child(1)').addClass('addt') $('.bospan:nth-child(2)').addClass('addt') $('.bospan:nth-child(3)').addClass('addt') } function showInin(obj,tem) { var arr = myObject.list2; for (var i = 0; i < arr.length; i++) { var htmltype= $("<p>"+arr[i]+"</p>") tem.find('.qna_two').append(htmltype) } } } }); })
转载请注明原文地址: https://www.6miu.com/read-2166.html

最新回复(0)