Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
SIDDHU123M authored Aug 29, 2024
1 parent 9a39845 commit 138e68a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ function checkLinkStatus(link, statusId) {

fetch(link.href, {mode: "no-cors"})
.then((response) => {
// Since we are using no-cors mode, we cannot check the response status
console.log(`Response for ${link.href}:`, response);
statusCircle.classList.add("online");
})
Expand All @@ -86,7 +85,9 @@ document.addEventListener("DOMContentLoaded", function () {
checkLinkStatus(link, statusCircle.id);
});

const isIndexPage = window.location.pathname.endsWith("index.html");
const isIndexPage =
window.location.pathname === "/" ||
window.location.pathname.endsWith("index.html");

const allLinks = document.querySelectorAll(
'main a:not(header a):not(.back-button a):not(.logo a):not([href^="#"]):not([href="index.html"])'
Expand Down

0 comments on commit 138e68a

Please sign in to comment.