samedi 28 février 2015

Prevent a form from being submitted javascript why is there an obvious false statement returning true?


<script>
function someFunc() {
if (1==2) {
return true;
} else {
alert("Not submitting");
return false;
}
}
</script>


This is from stackoverflow here


prevent form submission (javascript)


I want to know what the purpose of the obvious false statement 1==2 returns true is for?


Aucun commentaire:

Enregistrer un commentaire