Я просто пытаюсь посмотреть, существует ли файл < /p>
Код: Выделить всё
xhttp.open("GET", "/file.ext", true);
xhttp.send();
if (xhttp.status!=404) {alert("file found");} else {alert("file not found");};
< /code>
Я также думал о попытках < /p>
xhttp.open("GET", "/file.ext", true);
catch(err);
alert(err.message);
Подробнее здесь: https://stackoverflow.com/questions/797 ... javascript
Мобильная версия