diff options
| -rw-r--r-- | assets/js/red-links.js | 7 |
1 files changed, 7 insertions, 0 deletions
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', ''); } } }); |
