CDATA in script validates, but fails at runtime
Posted: Fri Sep 21, 2007 12:46 pm
Here's a code snippet:
When I validate the file with this snippet, I find no problems (unless I forget to put in the CDATA).
When I attept to run this code, I get an error of "expected an element name". It's attempting to interpret the as the start of an element name, or it's expecting a regardless of the CDATA declaration.
Code: Select all
<script>
<![CDATA[
// instantiate these
for ( var c = 0 ; c < requestTypes.length ; c++ ) {
s = requestTypes[c] + "=\"" + requestTypes[c] + "\""
eval ( s )
}
]]>
</script>
When I attept to run this code, I get an error of "expected an element name". It's attempting to interpret the
Code: Select all
<
Code: Select all
<