Colleagues.
I'm using the autocomplete of the jquery UI which is working properly, but I would like the results to also bring this code:
<i class="fa fa-user" aria-hidden="true"></i>
When I put it directly into PHP, it brings it as text, I believe I have to do this in Jquery. How would I do that? The code I'm using is:
<script>
$( function() {
function log( message ) {
$( "<div>" ).text( message ).prependTo( "#log" );
$( "#log" ).scrollTop( 0 );
}
$( "#txtUsuarios" ).autocomplete({
source: function( request, response ) {
$.ajax( {
url: "buscar-usuarios.php",
dataType: "json",
data: {
term: request.term
},
success: function( data ) {
response( data );
//response( data );
}
} );
},
minLength: 2,
select: function( event, ui ) {
log( "Selected: " + ui.item.value + " aka " + ui.item.id );
}
} );
} );
</script>