Twilo: Validator meckert rum

Beitrag lesen

Hallo,

ich habe folgenden Code

  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="de" xml:lang="de">  
<head>  
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
<title>test</title>  
</head>  
  
<body>  
<script type="text/javascript">  
  document.write('<p>test</p>');  
</script>  
</body>  
</html>  

der Validator gibt mir folgenden Fehler aus

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).

könnte mich einer aufklöären, warum das nicht funktioniert, oder eine entsprechende Lektüre geben :)

mfg
Twilo