From 5668e09a7bcc5b0ac72a29f457127f6763f07223 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Thu, 20 Dec 2018 17:43:53 +0100 Subject: red link check improvements --- assets/js/red-links.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/assets/js/red-links.js b/assets/js/red-links.js index 446db02..014f954 100644 --- a/assets/js/red-links.js +++ b/assets/js/red-links.js @@ -9,6 +9,11 @@ if (this.hostname != window.location.hostname) return; + var ext = this.href.split('.').pop().split(/\#|\?/)[0]; + + if (ext != "html") + this.css('color', 'red'); // pessimistic condition + var that = this; $.ajax({ type: 'HEAD', @@ -19,6 +24,8 @@ error: function (xhr, ajaxOptions, thrownError) { if (xhr.status == 404) { $(that).css('color', 'red'); + } else { + $(that).css('color', ''); } } }); -- cgit