下面是我的 AJAX 代码。我已经在评论中写了问题。
$.ajax({
type: "POST",
url: "dbtryout2_2.php",
data: datastr,
success: function(arrayphp) {
//here one by one text is being received from php from within a loop
//each text item is getting displayed as link here
//it is OK that text is getting displayed as link
//BUT the problem is that all the text returned from php are getting displayed as
//one link i.e between one "<a></a>"
//I WANT THAT EACH TEXT SHOULD BE DISPLAYED AS SEPERATE LINKS
//AS EACH TEXT IS GETTING RETURNED FROM WITHIN SEPARATE ITERATIONS OF PHP LOOP
var link = $('<a href="#" class="album"><font color="red">' + arrayphp + '</font></a>');
linkclass = link.attr("class");
$(".searchby .searchlist").append(link);
}
});
该怎么办?