diff --git a/wikinote/static/js/page.js b/wikinote/static/js/page.js index bf634c3..bb688b0 100644 --- a/wikinote/static/js/page.js +++ b/wikinote/static/js/page.js @@ -23,7 +23,11 @@ document.querySelectorAll('.tooltip.xref').forEach(function(el) { var xhr = new XMLHttpRequest(); xhr.addEventListener('load', function() { - el.querySelector('.tooltip-content').innerHTML = xhr.responseText; + if (xhr.status == 200) { + el.querySelector('.tooltip-content').innerHTML = xhr.responseText; + } else { + el.querySelector('.tooltip-content').innerHTML = 'Error'; + } }) xhr.open('GET', '/preview/' + el.dataset['xref']); xhr.send();