IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

HTML Discussion :

[W3C] Problème de validation W3C


Sujet :

HTML

  1. #1
    Futur Membre du Club
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    11
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2006
    Messages : 11
    Points : 7
    Points
    7
    Par défaut [W3C] Problème de validation W3C
    Bonjour,

    J'ai essayé avec W3C, mon fichier php et cela me sort 41 erreurs.

    La plupart des erreurs, je ne vois pas comment les réctifiés alors si quelqu'un peux m'aider?

    La page php est en pièce jointe et les erreurs sont :
    Line 23 column 17: there is no attribute "language".
    <script language="javascript">
    You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

    This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

    How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute.



    Error Line 23 column 29: required attribute "type" not specified.
    <script language="javascript">
    The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

    Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.



    Error Line 28 column 89: there is no attribute "STYLE".
    ...nerHTML = '<a href="index.php" STYLE="color:#2313ec">Accueil</a> |<a href="re


    Error Line 28 column 104: document type does not allow element "a" here.
    ...ref="index.php" STYLE="color:#2313ec">Accueil</a> |<a href="reco.php" STYLE="
    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).
    Fichiers attachés Fichiers attachés

  2. #2
    Inactif  
    Avatar de Kerod
    Profil pro
    Inscrit en
    Septembre 2004
    Messages
    11 672
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2004
    Messages : 11 672
    Points : 20 778
    Points
    20 778
    Par défaut
    Citation Envoyé par freedom.ghost
    Bonjour,
    J'ai essayé avec W3C, mon fichier php et cela me sort 41 erreurs.
    La plupart des erreurs, je ne vois pas comment les réctifiés alors si quelqu'un peux m'aider?
    Pas besoin de voir le code pour te donner les erreurs et la correction surtout qu'elle est déjà donné par le W3C.

    Line 23 column 17: there is no attribute "language".
    <script language="javascript">
    You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

    This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

    How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute.

    Il manque tout simplement le language

    Error Line 23 column 29: required attribute "type" not specified.
    <script language="javascript">
    The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

    Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.

    Il manque la définition du type="text/javascript"

    Error Line 28 column 89: there is no attribute "STYLE".
    ...nerHTML = '<a href="index.php" STYLE="color:#2313ec">Accueil</a> |<a href="re


    Error Line 28 column 104: document type does not allow element "a" here.
    ...ref="index.php" STYLE="color:#2313ec">Accueil</a> |<a href="reco.php" STYLE="
    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).
    STYLE existe pas en XHTML mais plutot style


    Et etc... tout est indiqué dans les commentaires

  3. #3
    Rédacteur

    Avatar de Yogui
    Homme Profil pro
    Directeur technique
    Inscrit en
    Février 2004
    Messages
    13 721
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Yonne (Bourgogne)

    Informations professionnelles :
    Activité : Directeur technique

    Informations forums :
    Inscription : Février 2004
    Messages : 13 721
    Points : 29 985
    Points
    29 985
    Par défaut
    Non lol, "there is no attribute language" signifie que la définition du HTML ne contient pas d'attribut "language" pour la balise "script"... Les balises Javascript s'écrivent de cette manière :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <script type="text/javascript"></script>
    De même pour les CSS :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <style type="text/css"></style>
    Sinon, en effet, il est recommandé de tout écrire en minuscules.

  4. #4
    Futur Membre du Club
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    11
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2006
    Messages : 11
    Points : 7
    Points
    7
    Par défaut
    Merci,

    J'ai essayé de continuer avec cette logique mais je bloque (maitenant il n'y a plus que 26 erreurs)

    Les voilà :
    Line 28 column 104: document type does not allow element "a" here.
    ...ref="index.php" style="color:#2313ec">Accueil</a> |<a href="reco.php" style="
    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 45 column 30: document type does not allow element "span" here.
    rub1 = ' <span class="close"><a href="">Final Fantasy</a></span><br/>';
    Line 45 column 70: document type does not allow element "br" here.
    ..."close"><a href="">Final Fantasy</a></span><br/>';
    Line 82 column 27: processing instruction does not start with name.
    <? include("menu.php"); ?>


    Line 258 column 11: character "&" is the first character of a delimiter but occurred as data.
    if(time>=6 & time<8)
    This message may appear in several cases:

    You tried to include the "<" character in your page: you should escape it as "&lt;"
    You used an unescaped ampersand "&": this may be valid in some contexts, but it is recommended to use "&amp;", which is always safe.
    Another possibility is that you forgot to close quotes in a previous tag.



    Warning Line 258 column 17: character "<" is the first character of a delimiter but occurred as data.
    if(time>=6 & time<8)

    Et encore merci

  5. #5
    Rédacteur

    Avatar de Yogui
    Homme Profil pro
    Directeur technique
    Inscrit en
    Février 2004
    Messages
    13 721
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Yonne (Bourgogne)

    Informations professionnelles :
    Activité : Directeur technique

    Informations forums :
    Inscription : Février 2004
    Messages : 13 721
    Points : 29 985
    Points
    29 985
    Par défaut
    Je t'ai dit dans ton autre sujet que les scripts PHP n'ont pas d'équivalent du validateur, à part l'exécutable PHP lui-même. N'envoie pas ton script PHP au validateur, cela n'a aucun intérêt : donne au validateur l'URL publique de ta page Web, là ça servira à quelque chose. Le validateur ne peut pas comprendre ton code PHP.

  6. #6
    Futur Membre du Club
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    11
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2006
    Messages : 11
    Points : 7
    Points
    7
    Par défaut
    Mais si j'envoie ma page c'est pareille que si j'envoie mon fichier au validateur,non?

  7. #7
    Membre éprouvé Avatar de zooro
    Homme Profil pro
    Développeur Java
    Inscrit en
    Avril 2006
    Messages
    921
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : France, Marne (Champagne Ardenne)

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Avril 2006
    Messages : 921
    Points : 1 260
    Points
    1 260
    Par défaut
    Ben non, le fichier contient ton script, alors que la page web contient le code (X)HTML généré par le script.
    C'est un valideur (X)HTML que tu utilises, pas un valideur PHP...

Discussions similaires

  1. [W3C] Problème de validation W3C
    Par killermano dans le forum Balisage (X)HTML et validation W3C
    Réponses: 5
    Dernier message: 19/03/2009, 09h52
  2. [W3C] Problème de validation w3c
    Par sofuzion dans le forum Balisage (X)HTML et validation W3C
    Réponses: 5
    Dernier message: 21/07/2008, 12h24
  3. [HTML 4.01] Problème de validation W3C
    Par arnaud_verlaine dans le forum Balisage (X)HTML et validation W3C
    Réponses: 4
    Dernier message: 08/06/2007, 11h29
  4. [W3C] Problème de validation XHTML 1.0 strict
    Par Cedrun dans le forum Balisage (X)HTML et validation W3C
    Réponses: 4
    Dernier message: 12/09/2006, 11h53
  5. [HTML / Viewpoint / Valid W3C] Problème de lecture
    Par zebden dans le forum Balisage (X)HTML et validation W3C
    Réponses: 2
    Dernier message: 01/02/2005, 11h15

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo