I am using python for backend and javascript for user interface, I have multiple files stored in folder and I want to display that using javascript.
function createRowMultiresult(jobjects) {
var $div = $('<div class="chat Bot"></div>');
var $div2 = $('<div class="user-photo"><img src="{% static "Robot.jpg%}" /></div>');
$div.append($div2);
var $tbl = $('<table style="width:100%;"></table>');
if (jobjects.length>1){
var $tr = $('<tr><td style="padding:5px;">Multiple results Found for
your query. Please search with specific keyword</td>
</tr>');
$tbl.append($tr);
}
for(var x=0; x<jobjects.length;x++){
var currentobj = jobjects[x];
if (currentobj.ans.indexOf("/AV") != -1){
var $tr = $('<tr><td style="padding:5px;"><a href="https://Guide' +
currentobj.ans +'" target="_blank" >Click Here
Guide</a></td></tr>');
$tbl.append($tr);
}
else if(currentobj.ans.indexOf("/AV") == -1){
var $tr = $('<tr><td style="padding:5px;">' +(x+1)+'.'+
currentobj.ans.replace(/[^ws]/gi, "<br/>") +'</td>
</tr>');
$tbl.append($tr);
if (currentobj.Pic.length>7){
var $tr = $("<tr><td style='text-align:center;'><img
class='productpic' src='{% static '/Pictures/' %}" + currentobj.Pic +"' /></td></tr>");
$tbl.append($tr);
}
else{
}
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…