So I am trying to get all my pages to validate perfectly. Going alright except this javascript stuff is holding me back. The problem is I am using the safe comment thingys so the JS isnt parsed as HTML. Well we have problems with this, like example:
Code: Select all
<script type="text/javascript">
<!--
//skip a bunch of lines
optn.text = '---Any---';
//finish it off
How do I fix this?invalid comment declaration: found name character outside comment but inside comment declaration.
Next Problem!
I try to do this:
Code: Select all
<noscript>(full name)</noscript>I don't get it.character data is not allowed here.
Last Problem (I hope)!
I try this code:
Code: Select all
document.write("<option value=\"1\">Allegheny</option>");As I translated that, I have to put quotes around it, which I did. I don't get it.an attribute value must be a literal unless it contains only name characters
*snip*
You have used a character that is not considered a "name character" in an attribute value. Which characters are considered "name characters" varies between the different document types, but a good rule of thumb is that unless the value contains only lower or upper case letters in the range a-z you must put quotation marks around the value. In fact, unless you have extreme file size requirements it is a very very good idea to always put quote marks around your attribute values. It is never wrong to do so, and very often it is absolutely necessary.