3
I have a variable that looks for a input
and from that she works getting information from her.
The problem I have is that when the input is not there, the script for saying that it cannot access properties of something indefinite: Cannot read Property '0' of Undefined.
How to ignore this or simply make a check for my script don’t stop? In PHP I would do something with isset
but in Javascript I have no idea...
files = $(".X");
if (files[0].files.length >= 1) {
//...
}