$.ajax({
type:"POST",
dataType: "json",
url:"url",
data:adata,
success:function(data){
console.log(data);
var arr=[];
for(var i in data){
arr.push(data[i])
}
var str="";
for(j=0;j<arr[2].length;jPP){
str+="<div class="question1">";
str+=""+arr[2][j].question+"
";
str+="<ul>";
str+="<li class="jjjj" value="A">"+arr[2][j].answera+"</li>";
str+="<li class="jjjj" value="B">"+arr[2][j].answerb+"</li>";
str+="<li class="jjjj" value="C">"+arr[2][j].answerc+"</li>";
str+="<li class="jjjj" value="D">"+arr[2][j].answerd+"</li>";
str+="</ul>";
str+="</div>";
}
$("-sharpcontainer").html(str);
this is the data I requested and the front-end rendering, but sometimes the data returned by the background is three options, sometimes four options, my current processing method is still four options, but there is a undefind, how to deal with it, ask God for help