Prob validation
ashpo
-
ashpo -
ashpo -
Bonsoir,
En faite je fai du javascript avec un tableau pour afficher plusieur couleur mais lorsque j'essaie de le valider à l'aide du W3C il me dit une erreur a ce niveau...
Voici le code:
<script type="text/javascript">
m="<table border='0'>";
m+="<tr>";
for (i=0; i<tab.length; i++) {
m+="<td style='background:url(\"Images/"+tab[i]+".png\");' onclick='changecoul(\""+tab[i]+"\")'></td>";
}
m+="</tr>";
m+="</table>";
document.getElementById("couleur").innerHTML=m;
</script>
Voici l'erreur du W3C:
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).
SVP AIDEZ-MOI!!! Je ne sais plus quoi faire...
En faite je fai du javascript avec un tableau pour afficher plusieur couleur mais lorsque j'essaie de le valider à l'aide du W3C il me dit une erreur a ce niveau...
Voici le code:
<script type="text/javascript">
m="<table border='0'>";
m+="<tr>";
for (i=0; i<tab.length; i++) {
m+="<td style='background:url(\"Images/"+tab[i]+".png\");' onclick='changecoul(\""+tab[i]+"\")'></td>";
}
m+="</tr>";
m+="</table>";
document.getElementById("couleur").innerHTML=m;
</script>
Voici l'erreur du W3C:
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).
SVP AIDEZ-MOI!!! Je ne sais plus quoi faire...
A voir également:
- Prob validation
- Commande en cours de validation fnac - Forum Consommation & Internet
- Temps validation annonce le bon coin - Forum Réseaux sociaux
- Annonce bon coin bloqueé a la verification,QUE Faire - Forum Réseaux sociaux
- Excel validation des données liste - Guide
- En cours de validation bancaire - Forum Réseaux sociaux
4 réponses
Salut.
Je pense que le problème se situe avant.
N'aurais-tu pas oublié de fermer une balise ? Ou bien tu n'as peut-être pas fermé correctement une balise auto-fermante (avec "/>" au bout, comme <link />, <meta />, ...).
Ou tu as peut-être placer une balise dans le body alors qu'elle ne peut se situer que dans le head.
Je pense que le problème se situe avant.
N'aurais-tu pas oublié de fermer une balise ? Ou bien tu n'as peut-être pas fermé correctement une balise auto-fermante (avec "/>" au bout, comme <link />, <meta />, ...).
Ou tu as peut-être placer une balise dans le body alors qu'elle ne peut se situer que dans le head.
Ceci est mon code en entier: et franchement je ne vois pas trop ce ki cloche :s
<!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" lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="Js/change_couleur.js" type="text/javascript"></script>
<title>Site </title>
<link rel="stylesheet" media="screen" href="Css/index.css" />
<link rel="stylesheet" media="screen" href="Css/960.css" />
</head>
<body id="change">
<div class="container_24">
<div class="grid_24" id="titre"></div>
<div class="grid_8 prefix_20" id="couleur">
<script type="text/javascript">
m="<table border='0'>";
m+="<tr>";
for (i=0; i<tab.length; i++) {
m+="<td style='background:url(\"Images/"+tab[i]+".png\");width:30px;height:30px;border:solid black 2px;' onclick='changecoul(\""+tab[i]+"\")'></td>";
}
m+="</tr>";
m+="</table>";
document.getElementById("couleur").innerHTML=m;
</script>
</div>
<!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" lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="Js/change_couleur.js" type="text/javascript"></script>
<title>Site </title>
<link rel="stylesheet" media="screen" href="Css/index.css" />
<link rel="stylesheet" media="screen" href="Css/960.css" />
</head>
<body id="change">
<div class="container_24">
<div class="grid_24" id="titre"></div>
<div class="grid_8 prefix_20" id="couleur">
<script type="text/javascript">
m="<table border='0'>";
m+="<tr>";
for (i=0; i<tab.length; i++) {
m+="<td style='background:url(\"Images/"+tab[i]+".png\");width:30px;height:30px;border:solid black 2px;' onclick='changecoul(\""+tab[i]+"\")'></td>";
}
m+="</tr>";
m+="</table>";
document.getElementById("couleur").innerHTML=m;
</script>
</div>
Oui oui je sais dsl mais cela ne resout pas mon probleme donc je recommence :D
Voici le 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" xml:lang="fr" lang="fr">
<head>
<title>Site </title>
<script src="Js/change_couleur.js" type="text/javascript"></script>
<link rel="stylesheet" media="screen" href="Css/index.css" />
<link rel="stylesheet" media="screen" href="Css/960.css" />
</head>
<body id="change">
<div class="container_24">
<div class="grid_24" id="titre"></div>
<div class="grid_8 prefix_20" id="couleur">
<script type="text/javascript">
m="<table>";
m+="<tr>";
for (i=0; i<tab.length; i++) {
m+="<td style='background:url(\"Images/"+tab[i]+".png\");width:30px;height:30px;border:solid black 2px;' onclick='changecoul(\""+tab[i]+"\")'></td>";
}
m+="</tr>";
m+="</table>";
document.getElementById("couleur").innerHTML=m;
</script>
</div>
<div class="grid_8" id="labo">
<img src="Images/labos.png" alt="labos" />
</div>
<div class="grid_8" id="presentation">
<p> Test </p>
</div>
<div class="grid_8" id="contact">
<img src="Images/contact.png" alt="contact" />
</div>
<div class="grid_8 suffix_16">
Ce site est en construction
</div>
</div>
</body>
</html>
Et revoici l'erreur di par w3c :
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).
Voici le 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" xml:lang="fr" lang="fr">
<head>
<title>Site </title>
<script src="Js/change_couleur.js" type="text/javascript"></script>
<link rel="stylesheet" media="screen" href="Css/index.css" />
<link rel="stylesheet" media="screen" href="Css/960.css" />
</head>
<body id="change">
<div class="container_24">
<div class="grid_24" id="titre"></div>
<div class="grid_8 prefix_20" id="couleur">
<script type="text/javascript">
m="<table>";
m+="<tr>";
for (i=0; i<tab.length; i++) {
m+="<td style='background:url(\"Images/"+tab[i]+".png\");width:30px;height:30px;border:solid black 2px;' onclick='changecoul(\""+tab[i]+"\")'></td>";
}
m+="</tr>";
m+="</table>";
document.getElementById("couleur").innerHTML=m;
</script>
</div>
<div class="grid_8" id="labo">
<img src="Images/labos.png" alt="labos" />
</div>
<div class="grid_8" id="presentation">
<p> Test </p>
</div>
<div class="grid_8" id="contact">
<img src="Images/contact.png" alt="contact" />
</div>
<div class="grid_8 suffix_16">
Ce site est en construction
</div>
</div>
</body>
</html>
Et revoici l'erreur di par w3c :
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).