1
I’m trying to pass a down to validate a list I need but I’m not getting it to work and I don’t understand why yet.
I have the following code:
$('#aprovados').click( function(){
$.getJSON($('#listeditappjobs').attr("data-list-app-my-jobs-url"),
function(data){
if (data){
var apps = data.data
console.log(apps[0])
var infojob = data.datas
console.log(infojob)
var aprovados = []
for(i = 0; i < apps.length; i++){
if (infojob.distance >= apps[i].distance &&
infojob.xp <= apps[i].years_xp &&
infojob.salary_min <= apps[i].pre_salary &&
infojob.salary_max >= apps[i].pre_salary)
{aprovados.push(apps[i]); }
};
console.log(aprovados)
}else{alert("LISTA vazia")
}},
);
});
What I got back is:
Object { distance: 1, escolaridade: "TecnologoCursando", user: "[email protected]", pre_salary: "1500.12", years_xp: 3 }
Object { distance: 2, xp: 3, salary_max: "1500.01", salary_min: "200.00" }
Array []
What I’m doing wrong?
Thanks man, you helped me a lot! ...regarding the data, I have a lot more I put there just example to be able to explain more or less what needs rs
– Jhonatan Teodoro