1
Hello, I’m trying to return information from a. php file in a specific div using jQuery. The situation is as follows: The information will be resumed for a div with id="bkpLoja", however this div is in a query section in the database and each registered store has its div in the following pattern "bkpLoja". $id_da_store; Follow the example
<div id=bkpLoja1>
conteudo...
</div>
<div id=bkpLoja2>
conteudo...
</div>
<div id=bkpLoja3>
conteudo...
</div>
jQuery code looks like this
function bkpLojas(id,bd) {
var resposta = confirm("Deseja realmente realizar backup deste registro?");
if (resposta == true) {
$.ajax({
type:'GET',
url:'exemplo.com.br/up.php',
data:'id='+id+"&bd="+bd,
success:function(data){
$("#bkpLoja").attr(id).html(data);
},
error:function(data){
alert("Ops! Erro:05, entre em contato com o suporte!");
}
});
}
}
I’ve tried that too:
$("#bkpLoja"+id).html(data);
Thanks in advance for the help attention of all!
The value that is coming in
id
that is correct?– BrTkCa
yes, the script works normal (except the part I asked). It just doesn’t return to correct div what the . php sends as echo.
– Jorge Borgonhi Batista