Bonjour,
Je n'arrive pas à rendre valide au W3C une page contenant du javascript.
Mon doctype:
Quand j'insère mon javascript comme ceci:
Mon script fonctionne sur mon site, mais ma page n'est pas valide au W3C.
et si je fais:
Mon script ne fonctionne plus sur mon site, mais ma page est valide au W3C.
Voyez vous le problème ?
Merci d'avance.
PS: Comment marche la balise couleur, dans la rédaction d'un message.
Modifié par yann123 (04 Mar 2009 - 11:40)
Je n'arrive pas à rendre valide au W3C une page contenant du javascript.
Mon doctype:
<!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" xml:lang="fr" >
Quand j'insère mon javascript comme ceci:
<script type='text/javascript'>
............
</script>
Mon script fonctionne sur mon site, mais ma page n'est pas valide au W3C.
a écrit :
Line 1, Column 0: no document type declaration; will parse without validation.
<script type='text/javascript'>
The document type could not be determined, because the document had no correct DOCTYPE declaration. The document does not look like HTML, therefore automatic fallback could not be performed, and the document was only checked against basic markup syntax.
Learn how to add a doctype to your document from our FAQ, or use the validator's Document Type option to validate your document against a specific Document Type.
Line 9, Column 48: character ")" not allowed in attribute specification list.
…nt(t.value.length)<nb_caracteres_mini)||(parseInt(t.value.length)>nb_caracter
Line 18, Column 2: "DOCTYPE" declaration not allowed in instance.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/x
Line 19, Column 57: document type does not allow element "HTML" here.
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
✉
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).
et si je fais:
<!-- Début du script
<script type='text/javascript'>
............
</script>//Fin du script -->
Mon script ne fonctionne plus sur mon site, mais ma page est valide au W3C.
Voyez vous le problème ?
Merci d'avance.
PS: Comment marche la balise couleur, dans la rédaction d'un message.
Modifié par yann123 (04 Mar 2009 - 11:40)