[thelist] Validating...

Simon Willison cs1spw at bath.ac.uk
Thu Oct 9 06:33:39 CDT 2003

George E. Papadakis wrote:
> When trying to validate a page (using the  MarkUp Validation Service )  that
> has some ad serving script included I get this error which seems not fixable
> .
> --
> column 163: document type does not allow element "iframe" here
> --
> This occurs propably because document.write ("<iframe ... insided the script
> tag makes the validator think that the iframe is actually nested within this
> tag (not acceptable).
> Is there anyway to fix this or even cheat the validator?

This is likely to cause a validity error anyway, as the character < 
should be escaped if it isn't part of a real tag - but actually escaping 
it with &lt; inside a chunk of javascript would probably break the 
script. My solution to this is to have ALL javascript in external .js 
files, where there's no need to escape any special characters.


Simon Willison

More information about the thelist mailing list