1
Colleagues.
I am using the jquery UI autocomplete which is working correctly, but I would like the results, also bring this code:
<i class="fa fa-user" aria-hidden="true"></i>
When I put it directly in PHP, it brings it as text, I believe I have to do it in Jquery. How would I do it? 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>