1
I’m making an Ajax request, where it works on Chrome perfectly but firefox does not work.
He tells me that Event is not defined
function pegarValor() {
dado = event.srcElement.innerText;
var XMLHttp = generateXMLHttp();
XMLHttp.open("get", "classes/getData.php?result=" + dado, true);
XMLHttp.onreadystatechange = function () {
if (XMLHttp.readyState == 4)
if (XMLHttp.status == 200) {
data = XMLHttp.responseText.split("#");
if(XMLHttp.responseText == ""){
$(".conteudo-select").html("Não foi encontrado");
}else{
$("#txtRazaoSocial").val(data[0]);
$("#txtCNPJ").val(data[1]);
$(".conteudo-select").fadeOut(500);
}
}
};
XMLHttp.send(null);
}
Ai in HTML has a
<div onlick='pegarValor()'>
Obs: Me trying to do $("#id"). on('click',Function(){ ... }) didn’t work.
thanks man, it worked
– gabrielfalieri