16 lines
935 B
JavaScript
16 lines
935 B
JavaScript
(function(){
|
|
const params = new URLSearchParams(location.search);
|
|
const code = params.get('code') || '404';
|
|
const title = params.get('title') || '';
|
|
const message = params.get('message') || '';
|
|
const details = params.get('details') || '';
|
|
document.getElementById('errorCode').textContent = code;
|
|
document.getElementById('errorTitle').textContent = title || (code === '404' ? 'Страница не найдена' : 'Ошибка');
|
|
document.getElementById('errorMessage').textContent = message || (code === '404' ? 'Запрашиваемая страница не существует или была перемещена.' : 'Произошла ошибка на сервере.');
|
|
if (details) {
|
|
document.getElementById('errorDetails').style.display = 'block';
|
|
document.getElementById('errorStack').textContent = details;
|
|
}
|
|
})();
|
|
|
|
document.querySelector('.error-actions button').addEventListener('click', () => history.back()); |