success: function(usernames){
//alert(usernames); ["adam","adam","adam","adam","adam"]
//alert(usernames.length); 36
var participants_list= eval(usernames); //adam,adam,adam,adam,adam
//alert(participants_list.length);5
var username= '';
for(var i=0; i<participants_list.length; i++){
username += participants_list[i] + "\n";
}
$("#usernames").html(username);
}
});
我正在尝试向#usernames 添加换行符,以便每个亚当将显示在新行上,但我不知道该怎么做。谢谢。
<td><div id="usernames">cindy</div></td>