Re: Javascript: character ";" not allowed in attribute specification list

Peter Bonjernoor <peter@zaph.nl>, 2010-11-24 21:48 +0100:

> The page this concerns is http://sec.zaph.nl/
> 
> Since it may well change in the near future (this is the development
> version) I have included the source that gives the errors, and the errors
> themselves below. The errors and warnings below are the only ones being
> found at the moment. I tried encapsulating the actual javascript with
> <!-- and -->, but that didn't change anything.
> 
> Code:
> 
> <script type='text/javascript'>
>         var a = document.getElementsByTagName('A');
>         var b;
>         for (var i=0; i<a.length; i++) { // <-- This is line 104
>                if (!a[i].onclick) {
> ....etcetera

There's nothing in there that will cause any problems in browsers, as long
as you're serving your content as text/html instead of with an XML MIME
type. So if your goal is to make sure your content will get processed as
expected, you're fine.

And if you are serving your content as text/html, you might consider
putting a <!DOCTYPE html> doctype or HTML4 doctype on it instead of an
XHTML one. That more accurately aligns how it will actually be processed by
UAs, and will also eliminate the error messages you're getting that are
caused by the validator treating it as an XML document instead of an
text/html one -- not by any actual errors in your source.

  --Mike

-- 
Michael(tm) Smith
http://people.w3.org/mike

Received on Wednesday, 1 December 2010 02:24:00 UTC