diff --git a/src/js/misc.js b/src/js/misc.js index 5d24643..9c86cec 100644 --- a/src/js/misc.js +++ b/src/js/misc.js @@ -35,8 +35,7 @@ function getHeightWidth(alt) { } const p_img = /\.+\\/gi; -const img = document.querySelectorAll("img"); -for (const i of img) { +for (const i of document.querySelectorAll("img")) { const regAlt = new RegExp("\\|"); const alt = i.alt; if (alt.match(regAlt)) { diff --git a/src/js/url_exist.js b/src/js/url_exist.js index 99fca41..72f9f84 100644 --- a/src/js/url_exist.js +++ b/src/js/url_exist.js @@ -113,10 +113,9 @@ for (const anchor of ht) { } } -const img = document.querySelectorAll("img"); -for (const image of img) { - if (image.hostname === window.location.hostname) { - var link = parseURL(image, 1); - history = checkIfInternalLinksExists(link.ref, link.title, image, history); - } +for (const image of document.querySelectorAll("img")) { + if (image.hostname === window.location.hostname) { + var link = parseURL(image, 1); + history = checkIfInternalLinksExists(link.ref, link.title, image, history); + } } \ No newline at end of file