I have file input. For demo, when anything else except .png or .jpg uploads, an alert message will come that says, "this file is not supported". So, I have written jQuery like this:
if (extension != 'png' || extension != 'jpg') {
alert('This file is not supported');
}
But, it seem that it's not working. If I cut from this portion, || extension != 'jpg', function will work perfectly. What's the problem with that line?
Aucun commentaire:
Enregistrer un commentaire