views:

38

answers:

2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml"&gt;
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 


onmouseover="text.show('<br /><b>XXXXXX</b><br />')"

Validation Output: Error:

character "<" is the first character of a delimiter but occurred as data

How can I fix it?

thanks

+1  A: 

Use &gt; and &lt; instead of < and >, respectively.

Alternatively, enclose the code in a <![CDATA[ ... ]]> section.

Patrick Niedzielski
Sorry about that, StackOverflow substituted < for `>`, just like you want. ^_^
Patrick Niedzielski
+1  A: 

You can also keep your Javascript in a separate file and include it with <script src="path/to/script.js"></script> and avoid having to escape it at all.

Will McCutchen