<suggestions>
<user>
<![CDATA[ Chris ]]>
</user>
<user>
<![CDATA[ Christina ]]>
</user>
</suggestions>
そしてjs部分
$.ajax({
type: "POST",
url: 'index.php/Suggest/',
dataType: 'xml',
data: {username: username},
success: function(data) {
$(data).find('suggestions').each(function(){
if ($(this).find('user').text()) {
$('#container').html('<div>' + $(this).find('user').text() + '</div>');
}
});
},
error: function(request, status, error) {
// will also occur when the user toggles a window and instantly clicks on a link, so don't alert anything
}
});
インサート
<div>ChrisChristina</div>
でも私はしたい
<div>Chris</div> <div>Christina</div>