I am making an Ajax request, where it works in Chrome perfectly however in firefox it does not work.
It 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);
}
There in HTML is a
<div onlick='pegarValor()'>