Parsing error or bug with Dreamweaver?
I'm not entirely sure if the issue here is with my code or if this is a bug in Dreamweaver. The code is working perfectly fine and checking the console in my browser tools isn't flagging anything as incorrect. I even tried figuring this out with ChatGDP, but nothing seems to be wrong with the code.
Does anyone know why Dreamweaver is flagging a parsing error (Unexpected token myLink) on line 1?
let myLink = document.getElementById("language");
getURL();
function getURL() {
if (myLink.pathname.endsWith("_no.htm")) {
let oldUrl = window.location.pathname; // get current URL
let newUrl = oldUrl.replace("_no.htm", ".htm"); // create new URL
document.getElementById("language").href = newUrl; // replace the current URL with the new
}
else if (myLink.pathname.endsWith(".htm")) {
let oldUrl = window.location.pathname; // get current URL
let newUrl = oldUrl.replace(".htm", "_no.htm"); // create new URL
document.getElementById("language").href = newUrl; // replace the current URL with the new
}
}
IS there any way I can fix this or should I just flag this to Adobe's developers?
