Twilo: Validator meckert rum

Beitrag lesen

Hallo Siechfred,,

Line 10, column 19: document type does not allow element "p" here
document.write('<p>test</p>');
könnte mich einer aufklöären, warum das nicht funktioniert, oder eine entsprechende Lektüre geben :)

Der Javascript-Bereich (eröffnet durch <script>) ist am Slash zu Ende. Das folgende P-Element ergibt somit keinen Sinn. Maskierst du den Slash mit einem Backslash, sollte das dein Problem lösen.

wenn du das so meinst

<script type="text/javascript">  
 document.write('<p>test<\/p>');  
</script>

bekomme ich 4 Fehler :-/

Line 10, column 19: document type does not allow element "p" here

document.write('<p>test</p>');

The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).

Line 10, column 24: character "<" is the first character of a delimiter but occurred as data

document.write('<p>test</p>');

If you wish to include the "<" character in your output, you should escape it as "&lt;". Another possibility is that you forgot to close quotes in a previous tag.

Line 11, column 8: end tag for "p" omitted, but OMITTAG NO was specified

</script>

You may have neglected to close a tag, or perhaps you meant to "self-close" a tag; that is, ending it with "/>" instead of ">".

Line 10, column 17: start tag was here

document.write('<p>test</p>');

mfg
Twilo