Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

284
Views
Why is it interpreting the code this way?

I've been getting this error: enter image description here

but the line of code it's referring to is for (let i = 0; i < chars.length; i++) {, which is placed within script tags. I don't understand why it isn't recognizing the JavaScript. Also, I'm coding in Notepad (it's saved as an xhtml document), and the browser is Chrome if that is relevant.

I've been having some other problems as well, like not being able to link in CSS, or include elements such as meta in the head section; the webpage comes out blank.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Everything in an XHTML document is parsed as XML, so when it reaches i < chars, the parser thinks the < is going to start a tag, and throws an error when it doesn't. A HTML parser knows to escape the contents between <script> and </script> tags but an XML parser doesn't.

When using XHTML, the < must be escaped within the JavaScript, either as &lt; or by being placed in a CDATA section.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!