Good afternoon guys,
I have the following AJAX request:
$(document).ready(function () {
$.ajax({
url: "/membros.aspx/populaGridMembros",
type: "POST",
dataType: "json",
contentType: "application/json; charset=utf-8",
success: function (result) {
populaTabela(result);
},
error: function() {
alert("Ocorreu um erro ao carregar os dados.");
}
});
});
The populaTabela method, takes the result of the PopulateGrid function and inserted it into a table on the page.
The problem is that when I run this code on the page, there is no error in the AJAX request, but it does not enter the success parameter. In the debugging of firefox I discovered that after it executes all this javascript code, ie during the debug step by all parameters of the $ .ajax function (url, type, dataType, contentType, success, and error the $ .ajax function returns values returned by the url populateGrid function and displayed a window with the following information:
Cananyonehelpme?Thanksinadvance!
HereisthecodeforthepopulaTabelafunction:
functionpopulaTabela(response){vardata=JSON.parse(response);for(varjindata){out+="<tr><td>" + data[j].NOME + "</td><td>" +
"</td><td>" + data[j].SOBRENOME + "</td><td>" +
"</td><td>" + data[j].RG + "</td><td>" +
"</td><td>" + data[j].CPF + "</td><td></tr>";
j++;
}
}