I am running my site through the W3C HTML Validator (http://validator.w3.org/), although I am getting a very odd error.
This is the error copied word for word:
Line 31, Column 29: character "&" is the first character of a delimiter but occurred as data
if( pageName != "blog.html" && pageName != "blog" ) {
✉
This message may appear in several cases:
You tried to include the "<" character in your page: you should escape it as "<"
You used an unescaped ampersand "&": this may be valid in some contexts, but it is recommended to use "&", which is always safe.
Another possibility is that you forgot to close quotes in a previous tag.
This is just a very small piece of Javascript within the <head>
of my site. This is the code:
<script type="text/javascript">
var pathName = window.location.pathname;
var pageName = pathName.substr( pathName.lastIndexOf("/") + 1 );
if( pageName != "blog.html" && pageName != "blog" ) {
document.write("<style type='text/css'>#article_intro_ag { display:none; } </style>");
}
</script>
Does anyone have any suggestions to why this is being displayed as an error within a HTML validator?
EDIT: This error occurs twice, for both &
symbols.