1
I’m walking a .each
and I would like you to present in the last position a alert
. So I’m trying to get the last position of index
:
if (index == len - 1) {
alert("Última posição");
}
Complete code:
$.getJSON("/Contrato/CriarCopiarContrato", { agrupamento: $("#listaAgrupamentos").val() },
function (result) {
$.each(result, function (index, itemData) {
if (index == len - 1) {
alert("ultima");
}
});
});
Had this line commented... Thanks for the repair :)
– CesarMiguel