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 retuned to a div with id="bkpLoja", but this div is in a section with query in the database and each registered store has its div in the following pattern "bkpLoja". $ Id_da_loja ; Follow the example
<div id=bkpLoja1>
conteudo...
</div>
<div id=bkpLoja2>
conteudo...
</div>
<div id=bkpLoja3>
conteudo...
</div>
the 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 it so tb:
$("#bkpLoja"+id).html(data);
From now on I thank you for your attention!