Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedded JS #330

Closed
Patresko opened this issue May 23, 2024 · 1 comment
Closed

Embedded JS #330

Patresko opened this issue May 23, 2024 · 1 comment

Comments

@Patresko
Copy link

Patresko commented May 23, 2024

Hello,

If I use embedded javascript syntax in the routine Im getting syntax highlighting error for <

&js< if (logoutTime === time) { location.reload(); } else if (time - logoutTime &lt; 10) { document.querySelector('[id*="textAfterBadge2"]').style.color = "red"; } else { document.querySelector('[id*="textAfterBadge2"]').style.color = "black"; };>

Maybe Im doing something wrong but within embedded javascript Im not able to use > or < so I replaced it with %lt or %gt

@isc-bsaviano
Copy link
Contributor

@Patresko This isn't a bug, it's a consequence of a bad design choice when defining the Embedded JS syntax. You can't use the unclosed > in the code because that's the character that terminates the embedding. If you need to use > in the code, use Marker Syntax. That link is for Embedded SQL but the same rules apply for JS. For example, you code can be changed to:

&js@@<
if (logoutTime === time) {
			location.reload();
		} else if (time - logoutTime < 10) {
			document.querySelector('[id*="textAfterBadge2"]').style.color = "red";
		} else {
			document.querySelector('[id*="textAfterBadge2"]').style.color = "black";
		};>@@

and it will syntax color, compile and run correctly. You can't use &lt; escaping.

@isc-bsaviano isc-bsaviano closed this as not planned Won't fix, can't repro, duplicate, stale May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants