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 :

problème validation w3C: "SHORTTAG YES" [XHTML 1.0]


Sujet :

HTML

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Profil pro
    Inscrit en
    Février 2009
    Messages
    100
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 100
    Par défaut problème validation w3C: "SHORTTAG YES"
    Salut a tous voila j'ai un souci lors de la validation de de ma petite page perso google, voici le code tout d'abord:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Mon Google by Romain</title>
    <link rel="stylesheet" type="text/css" href="noir.css" title="noir"/>
    <link rel="alternate stylesheet" type="text/css" href="marron.css" title="marron"/>
    <link rel="alternate stylesheet" type="text/css" href="bleu.css" title="bleu"/>
     
    <link rel="icon" type="image/png" href="images_google/favicon.ico" />
     
    <script type="text/javascript">
    function setActiveStyleSheet(title) 
    {
       var i, a, main;
       for(i=0; (a = document.getElementsByTagName("link")[i]); i++) 
       {
         if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) 
         {
           a.disabled = true;
           if(a.getAttribute("title") == title) a.disabled = false;
         }
       }
    };
    </script>
    </head>
     
    <body onload="document.f.q.focus();">
    <div id="conteneur">
    <div class="adresse_site">
    	<a href="http://motoetmotards.blogspot.com/">Blog moto et motards</a> ~ 
        <a href="http://www.niloo.fr/">Niloo</a> ~ 
        <a href="http://www.univ-rouen.fr/">Université de Rouen</a> ~ 
        <a href="http://www.reverso.net/text_translation.asp?lang=fr">Reverso</a> ~ 
        <a href="http://www.01net.com/telecharger/">01net</a> ~ 
        <a href="https://www.google.com/analytics/reporting/login?ctu=https%3A%2F%2Fwww.google.com%2Fanalytics%2Fsettings%2F%3F">Google Analytics</a> ~ 
        <a href="http://www.papygeek.com/">Papy Geek</a> ~ 
        <a href="http://www.deezer.com/fr">Deezer</a> ~ 
        <a href="http://www.megaupload.com/fr/">Megaupload</a>
    </div>   
     
    <div id="changement_fond"> 
    <!-- modification design -->
    	  <a href="javascript:setActiveStyleSheet('bleu');document.f.q.focus();"><img src="images_google/bleu.png" class="carre" alt="changer de fond"/></a> 
          <a href="javascript:setActiveStyleSheet('marron');document.f.q.focus();"><img src="images_google/marron.png" class="carre" alt="changer de fond"/></a> 
          <a href="javascript:setActiveStyleSheet('noir');document.f.q.focus();"><img src="images_google/noir.png" class="carre" alt="changer de fond"/></a>
    <!-- fin modification design -->
    </div>
    <div class="clear">
    </div>
    <div id="image_google">
    <img src="images_google/banniere.png" class="mon_google" alt="logo google"/>
    </div>
     
     
        <div class="google">
        <p>
        <a href="http://images.google.com/imghp?hl=fr&amp;tab=wi">Images</a> - 
        <a href="http://fr.youtube.com">Vidéos</a> - 
        <a href="http://mail.google.com/mail/?hl=fr&amp;tab=wm">Gmail</a> - 
        <a href="http://login.live.com/login.srf?id=2&amp;svc=mail&amp;cbid=24325&amp;msppjph=1&amp;lc=1036">Hotmail</a> - 
        <a href="http://www.lequipe.fr/">Sports</a>
        </p>
        </div>
     
    <!--début mise en forme formulaire google-->
    <div class="formulaire">
    <form action="http://www.google.com/search" name=f>
            <input name=hl type=hidden value=fr/>
            <input autocomplete="off" maxlength=2048 name=q size=55 title="Recherche Google" value=""/>
            <br />                         
            <input name="btnG" type="submit" value="Google by Romain" />
            <input name="btnI" type="submit" value="J'ai de la chance"/>
     
    <p><span class="texte_formulaire">  
         <input id="all" type="radio" name="meta" value="" checked />
          	<label for=all> </label>
         <label for=all>Web</label>
    		<label for=all> </label>
    		<input id="lgr" type="radio" name="meta" value="lr=lang_fr" />
    		<label for=lgr>Pages francophones</label>
     
    </span></p>
    </form>
    </div>
    <!--début mise en forme formulaire google-->
     
    <div id="copyright">
    <br />Copyright © 2009 <a href="XXXXXX">XXXXXX</a>
    </div>
     
    <div id="citation">
    Surfer sur Internet c'est comme pour le sexe: tout le monde se vante de faire plus qu'il ne fait...
    </div>      
    </div>
    </body>
    </html>

    et donc j'ai ce type d'erreur avec SHORTTAG YES , les voila:

    # Error Line 68, Column 49: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified.

    <form action="http://www.google.com/search" name=f>


    # Error Line 69, Column 20: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified.

    <input name=hl type=hidden value=fr/>


    # Error Line 69, Column 28: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified.

    <input name=hl type=hidden value=fr/>


    # Error Line 69, Column 41: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified.

    <input name=hl type=hidden value=fr/>

    # Error Line 70, Column 44: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified.

    … <input autocomplete="off" maxlength=2048 name=q size=55 title="Recherche Goo


    # Error Line 70, Column 54: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified.

    …tocomplete="off" maxlength=2048 name=q size=55 title="Recherche Google" value


    # Error Line 70, Column 61: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified.

    … <input autocomplete="off" maxlength=2048 name=q size=55 title="Recherche Google" value=""/>


    # Error Line 76, Column 64: the name and VI delimiter can be omitted from an attribute specification only if SHORTTAG YES is specified.

    … id="all" type="radio" name="meta" value="" checked />



    "VI delimiter" is a technical term for the equal sign. This error message means that the name of an attribute and the equal sign cannot be omitted when specifying an attribute. A common cause for this error message is the use of "Attribute Minimization" in document types where it is not allowed, in XHTML for instance.

    How to fix: For attributes such as compact, checked or selected, do not write e.g <option selected ... but rather <option selected="selected" ...
    # Error Line 77, Column 18: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified.

    <label for=all> </label>


    # Error Line 78, Column 16: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified.

    <label for=all>Web</label>


    # Error Line 79, Column 13: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified.

    <label for=all> </label>


    # Error Line 81, Column 13: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified.

    <label for=lgr>Pages francophones</label>


    Donc si vous avez des petites idées...
    merci

  2. #2
    Membre chevronné Avatar de Neroptik
    Profil pro
    Étudiant
    Inscrit en
    Novembre 2005
    Messages
    337
    Détails du profil
    Informations personnelles :
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Novembre 2005
    Messages : 337
    Par défaut
    Tu oublie pas mal de guillemets un peu partout :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <balise param="valeur"...
    Ca devrai régler les 3/4 des erreurs

    EDIT : A la ligne 76 la valeur est carrément à côté des guillemets

  3. #3
    Membre chevronné
    Profil pro
    Inscrit en
    Février 2009
    Messages
    308
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 308
    Par défaut
    Arf griller par Neroptik :p

    En gros la majeur partie de tes erreurs SHORTTAG YES sont du à ça

  4. #4
    Membre chevronné Avatar de Neroptik
    Profil pro
    Étudiant
    Inscrit en
    Novembre 2005
    Messages
    337
    Détails du profil
    Informations personnelles :
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Novembre 2005
    Messages : 337
    Par défaut
    Même toutes en fait

  5. #5
    Membre chevronné
    Profil pro
    Inscrit en
    Février 2009
    Messages
    308
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 308
    Par défaut
    Surement mais j'avais la flemme de faire le tour complet :p

  6. #6
    Membre confirmé
    Profil pro
    Inscrit en
    Février 2009
    Messages
    100
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 100
    Par défaut
    ok merci les gas désolé de répondre aussi tard je n'avais pas accès a internet c'était sa en effet il faudrait que j'ouvre l'œil la prochaine fois... c'est vraiment des erreurs toute bête

    J'ai encore 3 petites erreurs que j'arrive toujours pas a résoudre:

    2 au niveaux du javascript, a cause des deux & (j'ai bien essayer de les remplacer par &amp; mais après sa ne fonctionne plus):

    Line 18, Column 53: character "&amp;" is the first character of a delimiter but occurred as data.

    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title"))

    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 18, Column 54: character "&amp;" is the first character of a delimiter but occurred as data.

    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title"))

    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.




    et une dans le code html au niveau de cette ligne:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
            <input autocomplete="off" maxlength="2048" name="q" size="55" title="Recherche Google" value=""/>
    voici ce que me dit le w3C:

    Line 70, Column 28: there is no attribute "autocomplete".

    <input autocomplete="off" maxlength="2048" name="q" size="55" title="Rec
    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. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.


    merci

  7. #7
    Rédacteur

    Avatar de Bovino
    Homme Profil pro
    Développeur Web
    Inscrit en
    Juin 2008
    Messages
    23 647
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juin 2008
    Messages : 23 647
    Billets dans le blog
    20
    Par défaut
    Normal, le validateur ne comprend pas qu'il s'agit de code JavaScript et comprend les & comme des caractères spéciaux.
    Le truc est de mettre le code JavaScript dans des commentaires HTML.

    Pour le autocomplete, il n'y a rien à faire, à part éventuellement le retire et l'affecter en JavaScript au chargement de la page.
    Pas de question technique par MP !
    Tout le monde peut participer à developpez.com, vous avez une idée, contactez-moi !
    Mes formations video2brain : La formation complète sur JavaScriptJavaScript et le DOM par la pratiquePHP 5 et MySQL : les fondamentaux
    Mon livre sur jQuery
    Module Firefox / Chrome d'intégration de JSFiddle et CodePen sur le forum

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Problème validation W3C et fonction js
    Par scary dans le forum Balisage (X)HTML et validation W3C
    Réponses: 6
    Dernier message: 11/11/2008, 19h28
  2. [W3C] problème validation W3C
    Par Maxime44 dans le forum Balisage (X)HTML et validation W3C
    Réponses: 5
    Dernier message: 18/06/2008, 12h40
  3. [W3C] Problème validation w3c avec html/javascript
    Par mademoisellem dans le forum Balisage (X)HTML et validation W3C
    Réponses: 22
    Dernier message: 31/01/2008, 16h19
  4. [W3C] problème validation W3C d'un site
    Par nicolas77 dans le forum Balisage (X)HTML et validation W3C
    Réponses: 3
    Dernier message: 13/04/2006, 14h04

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