-1

I am getting an "Error parsing XML: not well-formed" message with the following line in javascript:

for (var i=1; i<=totalImgs; i++)

Removing the < character from this line clears up the parsing error, but then the javascript doesn't work. Are there any solutions to this?

GoBusto
  • 4,632
  • 6
  • 28
  • 45
Teiki
  • 1

1 Answers1

1

Here are three possible solutions:

  • Move the script into a separate .js file so that the XML parser won't see it.
  • Surround the script contents with <![CDATA[ ]]> (See this question for further details).
  • Use an XML character entity reference (i.e. &lt;) instead of a literal <
Community
  • 1
  • 1
GoBusto
  • 4,632
  • 6
  • 28
  • 45