Код: Выделить всё
function getcontent(year)
{
var iframe = document.getElementById('content');
iframe.src = year + ".html";
}
. В iframe просто отлично, если файл не существует, я получаю сообщение по умолчанию в браузерах. Что я хотел бы сделать, так это отобразить мой пустой файл. HTML. Оценка. event
using javascript to detect whether the url exists before display in iframe
Check if a file exists locally using JavaScript only
Check if a local HTML file exists and redirect to it if it does
Check if image exists on server using JavaScript?
Подробнее здесь: https://stackoverflow.com/questions/796 ... es-not-exi