Skip to main content
sja_odin
Inspiring
May 27, 2023
Answered

Parsing error or bug with Dreamweaver?

  • May 27, 2023
  • 5 replies
  • 1941 views

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?

This topic has been closed for replies.
Correct answer sja_odin

Update: I had a remote session with an Adobe employee to troubleshoot and try to figure out this issue. It seems to disappear when you're working in a site. If you have an idependant file outside a site, this parsing error appears. So it does indeed appear to be a bug and now at least we know why no one else was able to recreate the issue. 😊

5 replies

sja_odin
sja_odinAuthorCorrect answer
Inspiring
June 20, 2023

Update: I had a remote session with an Adobe employee to troubleshoot and try to figure out this issue. It seems to disappear when you're working in a site. If you have an idependant file outside a site, this parsing error appears. So it does indeed appear to be a bug and now at least we know why no one else was able to recreate the issue. 😊

sja_odin
sja_odinAuthor
Inspiring
June 14, 2023

@Nayan_Kankariya, can you please confirm I got an email from you about this?

Nayan_Kankariya
Community Manager
Community Manager
June 14, 2023

Hi @sja_odin,

 

Yes, we confirm we tried reaching to you over email.

 

Thanks,

Nayan

Dreamweaver Team

Community Expert
June 1, 2023

I'm not sure I understand your problem, and I may be way off the mark, so I tested your code in DW, and I don't get any errors that are noticed by the internal lint mechanism... please, could you be more specific?

 

 

sja_odin
sja_odinAuthor
Inspiring
June 1, 2023

My DW is up-to-date, so I don't think that's the issue. I have more script code before and after this, but all my brackets are closed and semicolons etc. are in place, so there shouldn't be anything messing this up. I even tried removing everything else from the file and still got this error.

Nancy OShea
Community Expert
June 1, 2023

I tried your code in <script> tags within a HTML document and without <script> tags in  separate .js file.  No ERRORS in either one.

 

I think Lena's right.  Something else in your code is amiss.

 

 

 

Nancy O'Shea— Product User, Community Expert & Moderator
Nancy OShea
Community Expert
May 27, 2023
quote

IS there any way I can fix this?

By @sja_odin

============

Turn off code Linting from Preferences panel (Ctrl + U). 

Or just ignore the warnings. 😏

 

Nancy O'Shea— Product User, Community Expert & Moderator
Community Expert
May 27, 2023

Dreamweaver is in minimal maintenance mode so I wouldn't expect updates for this. In these instances it's usually that your code is too modern and with DW as out of date as it is, it will just return errors even if there is not one. If you rely on keeping up with coding standards it is likely a best bet to start looking for alternatives.

sja_odin
sja_odinAuthor
Inspiring
May 29, 2023

This was the impression I was getting, but I just wanted to confirm, thank you.

I didn't realised DW wasn't kept up-to-date – why is that? Is it on its way to being discontinued?

Nancy OShea
Community Expert
May 29, 2023

Adobe has not expressed plans to discontinue Dreamweaver.  But no new features are planned except minimal security & compatibility updates.

 

You can use Dreamweaver alongside other code editors like Visual Studio Code.

 

 

Nancy O'Shea— Product User, Community Expert & Moderator