0
all right?
I’m having a very boring question here and I haven’t been able to find any viable solutions.
Well, I’ll explain the problem.
This is my class where I will return my query
<div class="col-lg-2 result">
... AQUI DENTRO ESTARÁ A CONSULTA INICIAL DA PAGINA
</div>
and this is my code to make every letter I type return the query to me
$(function(){
//Pesquisar os cursos sem refresh na página
$("#pesquisa").keyup(function(){
var pesquisa = $(this).val();
//Verificar se há algo digitado
if(pesquisa != ''){
var dados = {
palavra : pesquisa
}
$.post('busca.php', dados, function(retorna){
$(".result").html(retorna);
});
}else{
$('.result').load('');
}
});
});
Now the problem, when I do the search she subscribes to div ( this I want to happen), but when deleting all typed letters, I need the div back to the original state, ie the state in which only my php query acts on the code.
Someone would have a tip on how to fix this?
You have tried using Jquery Autocomplete ?
– Bruno
Why php does not return this html in case the search is empty?
– Sergio
https://answall.com/questions/210711/combobox-ajax-php-nao-retorna-nada?noredirect=1#comment430860_210711
– Somdesp