.reverse()
.function func(arr, parametres) {
for (let i = 0; i < parametres.length; i++) {
const param = parametres[i];
let condition = null;
if (param.type === 'type1') {
condition = true;
} else if (param.type === 'type2') {
condition = false;
} else {
continue;
}
let hasSameProperties = false;
for (let j = 0; j < arr.length; j++) {
if (
arr[j].property1 === param.property1 &&
arr[j].property2 === param.property2
) {
hasSameProperties = true;
break;
}
}
if (hasSameProperties === condition) return false;
}
return true;
};
var btn = document.getElementById("auth");
btn.onclick = function() {
var msg=new FormData($('#login')[0]);
$.ajax({
type: 'POST',
url: '/login',
contentType: false,
cache: false,
processData: false,
data: msg,
success: function(data) {
console.log(data);
if (data=='1') {
window.location.href = "/news"
} else {
alert( "Invalid login or password" );
}
},
error: function(jqXHR, textStatus, errorThrown) {
console.log('debag');
console.log(jqXHR, textStatus, errorThrown);
}
});
};