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 validation w3c avec html/javascript


Sujet :

HTML

  1. #1
    Candidat au Club
    Inscrit en
    Janvier 2008
    Messages
    15
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 15
    Points : 3
    Points
    3
    Par défaut [W3C] Problème validation w3c avec html/javascript
    Bonjour,
    j'ai un problème de validation de ma page HTML. En effet j'ai inséré du code javascript dans ma page HTML afin de changer de bouton en rollover.
    Cependant cela pose problème pour la validation par le w3c. Quelqu'un saurait-il comment faire pour que ma page soit valide?
    Voici le code.
    Merci d'avance.

    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
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
     <head>
       <title>Les pirates</title>
       <meta http-equiv="content-type" content="text/html; charset=utf-8" />
       <link type="text/css" rel="stylesheet" href="style.css"/>
     </head>
     <body>
     
     <div id="page">
     
     
        <div id="header" >
     
     
    	</div>
     
     
     
    	  <div id="sommaire">
        <img src="images/images/cote_gauche.jpg" alt="" /><a href="histoire.html"onmouseover="document.histoire.src='images/survol/bouton1.jpg'" onmouseout="document.histoire.src='images/images/bouton1.jpg'"><img src="images/images/bouton1.jpg" name="histoire" alt="" /></a><a href="pirates.html"onmouseover="document.pirates.src='images/survol/bouton2.jpg'" onmouseout="document.pirates.src='images/images/bouton2.jpg'"><img src="images/images/bouton2.jpg" name="pirates" alt="" /></a><a href="rhum.html"onmouseover="document.rhum.src='images/survol/bouton3.jpg'" onmouseout="document.rhum.src='images/images/bouton3.jpg'"><img src="images/images/bouton3.jpg" name="rhum" alt=""  /></a><a href="cambuse.html"onmouseover="document.cambuse.src='images/survol/bouton4.jpg'" onmouseout="document.cambuse.src='images/images/bouton4.jpg'"><img src="images/images/bouton4.jpg" name="cambuse" alt=""  /></a><a href="navires.html"onmouseover="document.navires.src='images/survol/bouton5.jpg'" onmouseout="document.navires.src='images/images/bouton5.jpg'"><img src="images/images/bouton5.jpg" name="navires" alt="" /></a><a href="contact.html"onmouseover="document.contact.src='images/survol/bouton6.jpg'" onmouseout="document.contact.src='images/images/bouton6.jpg'"><img src="images/images/bouton6.jpg" name="contact" alt="" /></a><a href="contact.html"onmouseover="document.contact.src='images/survol/bouton6.jpg'" onmouseout="document.contact.src='images/images/bouton6.jpg'"><img src="images/images/cote_droit.jpg" alt="" class="menu"/></a><a href="pirates.html"onmouseover="document.pirates.src='images/survol/bouton2.jpg'" onmouseout="document.pirates.src='images/images/bouton2.jpg'"></a></div>
     
     
     
     
     
     
    	 <div id="contenu" >
     
    	 <div class="texte">
    	 <h4>La cambuse</h4><BR/>
    		 <img src="images/cambuse.jpg" alt="" class="img_cambuse" />
     
     </div>
     
     
    	</div>
     
     
     </div>
     </body>
    </html>
    Fichiers attachés Fichiers attachés

  2. #2
    Rédacteur
    Avatar de _Mac_
    Profil pro
    Inscrit en
    Août 2005
    Messages
    9 601
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2005
    Messages : 9 601
    Points : 12 977
    Points
    12 977
    Par défaut
    Hello, bienvenue sur le forum,

    Tu as passé ta page au validator W3 ? http://validator.w3.org/. Il y a une option pour télécharger le code HTML que tu veux valider. Là, il va t'afficher toute une série d'erreur. Il faut les corriger une par une. En faisant le test, je trouve tout ça :

    Citation Envoyé par Validator W3
    Validation Output: 15 Errors

    1. Error Line 22, Column 246: there is no attribute "name".

    …src="images/images/bouton1.jpg" name="histoire" alt="" /></a><a href="pirates



    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.
    2. Error Line 32, Column 25: element "BR" undefined.

    <h4>La cambuse</h4><BR/>



    You have used the element named above in your document, but the document type you are using does not define an element of that name. 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 "Frameset" document type to get the "<frameset>" element),
    * by using vendor proprietary extensions such as "<spacer>" or "<marquee>" (this is usually fixed by using CSS to achieve the desired effect instead).
    * by using upper-case tags in XHTML (in XHTML attributes and elements must be all lower-case).
    3. Error Line 22, Column 77: XML Parsing Error: attributes construct error.

    …jpg" alt="" /><a href="histoire.html"onmouseover="document.histoire.src='imag


    4. Error Line 22, Column 77: XML Parsing Error: Couldn't find end of Start Tag a line 22.

    …jpg" alt="" /><a href="histoire.html"onmouseover="document.histoire.src='imag


    5. Error Line 22, Column > 80: XML Parsing Error: Opening and ending tag mismatch: div line 21 and a.

    …" alt="" /><a href="histoire.html"onmouseover="document.histoire.src='images/…


    6. Error Line 22, Column > 80: XML Parsing Error: attributes construct error.

    …" alt="" /><a href="histoire.html"onmouseover="document.histoire.src='images/…


    7. Error Line 22, Column > 80: XML Parsing Error: Couldn't find end of Start Tag a line 22.

    …" alt="" /><a href="histoire.html"onmouseover="document.histoire.src='images/…


    8. Error Line 22, Column > 80: XML Parsing Error: Opening and ending tag mismatch: div line 11 and a.

    …" alt="" /><a href="histoire.html"onmouseover="document.histoire.src='images/…


    9. Error Line 22, Column > 80: XML Parsing Error: attributes construct error.

    …" alt="" /><a href="histoire.html"onmouseover="document.histoire.src='images/…


    10. Error Line 22, Column > 80: XML Parsing Error: Couldn't find end of Start Tag a line 22.

    …" alt="" /><a href="histoire.html"onmouseover="document.histoire.src='images/…


    11. Error Line 22, Column > 80: XML Parsing Error: Opening and ending tag mismatch: body line 9 and a.

    …" alt="" /><a href="histoire.html"onmouseover="document.histoire.src='images/…


    12. Error Line 22, Column > 80: XML Parsing Error: attributes construct error.

    …" alt="" /><a href="histoire.html"onmouseover="document.histoire.src='images/…


    13. Error Line 22, Column > 80: XML Parsing Error: Couldn't find end of Start Tag a line 22.

    …" alt="" /><a href="histoire.html"onmouseover="document.histoire.src='images/…


    14. Error Line 22, Column > 80: XML Parsing Error: Opening and ending tag mismatch: html line 3 and a.

    …" alt="" /><a href="histoire.html"onmouseover="document.histoire.src='images/…


    15. Error Line 22, Column > 80: XML Parsing Error: Extra content at the end of the document.

    …" alt="" /><a href="histoire.html"onmouseover="document.histoire.src='images/…
    En mettant un espace avant onmouseover dans tes balises <a>, tu réduis déjà énormément le nombre d'erreurs.

    Du détail, du détail, du détail !!!
    Revenons à la source : lisons la documentation et les fichiers de trace, la réponse à notre problème s'y trouve sans doute

  3. #3
    Candidat au Club
    Inscrit en
    Janvier 2008
    Messages
    15
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 15
    Points : 3
    Points
    3
    Par défaut
    Merci, effectivement, il y en a moins, mais il y en a toujours, il n'y a pas une solution pour ne plus avoir d'erreurs ?
    est-ce possible d'externaliser le code ?

  4. #4
    Membre émérite Avatar de franculo_caoulene
    Profil pro
    Inscrit en
    Octobre 2003
    Messages
    2 880
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2003
    Messages : 2 880
    Points : 2 953
    Points
    2 953
    Par défaut
    Salut,

    Ton fichier est compris comme du xml. Deux choix s'offrent à toi:
    - inclure tout le javascript dans un fichier comme tu l'as dit
    - inclure le code j'avascript entre des balises (je ne sais pas finalement si ce sont des balises) <![CDATA[ blabla ]]>. Syntaxe à vérifier.
    Les Cours et tutoriels JavaScript
    Penser à la recherche et au bouton

  5. #5
    Rédacteur
    Avatar de _Mac_
    Profil pro
    Inscrit en
    Août 2005
    Messages
    9 601
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2005
    Messages : 9 601
    Points : 12 977
    Points
    12 977
    Par défaut
    Citation Envoyé par mademoisellem Voir le message
    Merci, effectivement, il y en a moins, mais il y en a toujours, il n'y a pas une solution pour ne plus avoir d'erreurs ?
    est-ce possible d'externaliser le code ?
    Tu as fait quoi comme modifications ? Il ressemble à quoi, ton code final et quelles sont les erreurs remontées par le validator ? Généralement, elles sont assez explicites : avec ton code, il y avait 3 sortes d'erreurs : l'espace manquant avant les onmouseover, un <BR/> au lieu de <br/> (les balises en XHTML sont en minuscules) et un attribut name en trop dans une balise <img>. Il faut donc corriger ces 3 erreurs et repasser la validation et voir ce que dit le validator.

    Du détail, du détail, du détail !!!
    Revenons à la source : lisons la documentation et les fichiers de trace, la réponse à notre problème s'y trouve sans doute

  6. #6
    Candidat au Club
    Inscrit en
    Janvier 2008
    Messages
    15
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 15
    Points : 3
    Points
    3
    Par défaut
    1. Line 24, Column 247: there is no attribute "name".

    …src="images/images/bouton1.jpg" name="histoire" alt="" /></a><a href="pirates



    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.
    2. Error Line 24, Column > 80: XML Parsing Error: attributes construct error.

    …" alt="" /><a href="histoire.html" onmouseover="document.histoire.src='images…


    3. Error Line 24, Column > 80: XML Parsing Error: Couldn't find end of Start Tag a line 24.

    …" alt="" /><a href="histoire.html" onmouseover="document.histoire.src='images…


    4. Error Line 24, Column > 80: XML Parsing Error: Opening and ending tag mismatch: div line 22 and a.

    …" alt="" /><a href="histoire.html" onmouseover="document.histoire.src='images…


    5. Error Line 24, Column > 80: XML Parsing Error: attributes construct error.

    …" alt="" /><a href="histoire.html" onmouseover="document.histoire.src='images…


    6. Error Line 24, Column > 80: XML Parsing Error: Couldn't find end of Start Tag a line 24.

    …" alt="" /><a href="histoire.html" onmouseover="document.histoire.src='images…


    7. Error Line 24, Column > 80: XML Parsing Error: Opening and ending tag mismatch: div line 12 and a.

    …" alt="" /><a href="histoire.html" onmouseover="document.histoire.src='images…


    8. Error Line 24, Column > 80: XML Parsing Error: Opening and ending tag mismatch: body line 10 and div.

    …" alt="" /><a href="histoire.html" onmouseover="document.histoire.src='images…


    9. Error Line 48, Column 7: XML Parsing Error: Opening and ending tag mismatch: html line 3 and div.

    </div>


    10. Error Line 49, Column 1: XML Parsing Error: Extra content at the end of the document.

    </body>

    j'ai essayé d'inlure le code javascript dans un fichier externe mais je suis novice en javascript, je ne vois donc pas vraiment comment le HTML du javascript...

  7. #7
    Candidat au Club
    Inscrit en
    Janvier 2008
    Messages
    15
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 15
    Points : 3
    Points
    3
    Par défaut
    ça y est c'est résolu pour cette page, grâce à vos conseils,merci beaucoup ! cependant j'ai une erreur sur une autre page.

    1. Error Line 12, Column 19: required attribute "id" not specified.

    <map name="mappy">



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

  8. #8
    Rédacteur
    Avatar de _Mac_
    Profil pro
    Inscrit en
    Août 2005
    Messages
    9 601
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2005
    Messages : 9 601
    Points : 12 977
    Points
    12 977
    Par défaut
    Bah, comme c'est marqué : required attribute "id" not specified. Faut rajouter un attribut id dans ta balise <map> :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <map name="mappy" id="mappy">

    Du détail, du détail, du détail !!!
    Revenons à la source : lisons la documentation et les fichiers de trace, la réponse à notre problème s'y trouve sans doute

  9. #9
    Candidat au Club
    Inscrit en
    Janvier 2008
    Messages
    15
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 15
    Points : 3
    Points
    3
    Par défaut
    merci beaucoup ! il n'y a plus d'erreurs !

  10. #10
    Candidat au Club
    Inscrit en
    Janvier 2008
    Messages
    15
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 15
    Points : 3
    Points
    3
    Par défaut
    en fait si, 'javais utilisé les balises conseillées par franculo,
    ""
    - inclure le code j'avascript entre des balises (je ne sais pas finalement si ce sont des balises) <![CDATA[ blabla ]]>. Syntaxe à vérifier.""

    effectivment quand on les met c'est bien valide, mais mon menu n'apparait plus !!!!

  11. #11
    Modérateur
    Avatar de Bisûnûrs
    Profil pro
    Développeur Web
    Inscrit en
    Janvier 2004
    Messages
    9 868
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Janvier 2004
    Messages : 9 868
    Points : 16 258
    Points
    16 258
    Par défaut
    Au lieu des balises CDATA, tu aurais pu mettre ton code Javascript entre commentaires HTML :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    <script type="text/javascript">
    <!--
     
    Ici ton code Javascript
     
    //-->
    </script>

  12. #12
    Candidat au Club
    Inscrit en
    Janvier 2008
    Messages
    15
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 15
    Points : 3
    Points
    3
    Par défaut
    j'ai toujours ces erreurs....


    1. Line 24, Column 247: there is no attribute "name".

    …src="images/images/bouton1.jpg" name="histoire" alt="" /></a><a href="pirates



    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.
    2. Error Line 24, Column > 80: XML Parsing Error: attributes construct error.

    …" alt="" /><a href="histoire.html" onmouseover="document.histoire.src='images…


    3. Error Line 24, Column > 80: XML Parsing Error: Couldn't find end of Start Tag a line 24.

    …" alt="" /><a href="histoire.html" onmouseover="document.histoire.src='images…


    4. Error Line 24, Column > 80: XML Parsing Error: Opening and ending tag mismatch: div line 22 and a.

    …" alt="" /><a href="histoire.html" onmouseover="document.histoire.src='images…


    5. Error Line 24, Column > 80: XML Parsing Error: attributes construct error.

    …" alt="" /><a href="histoire.html" onmouseover="document.histoire.src='images…


    6. Error Line 24, Column > 80: XML Parsing Error: Couldn't find end of Start Tag a line 24.

    …" alt="" /><a href="histoire.html" onmouseover="document.histoire.src='images…


    7. Error Line 24, Column > 80: XML Parsing Error: Opening and ending tag mismatch: div line 12 and a.

    …" alt="" /><a href="histoire.html" onmouseover="document.histoire.src='images…


    8. Error Line 24, Column > 80: XML Parsing Error: Opening and ending tag mismatch: body line 10 and div.

    …" alt="" /><a href="histoire.html" onmouseover="document.histoire.src='images…


    9. Error Line 49, Column 8: XML Parsing Error: Opening and ending tag mismatch: html line 3 and div.

    </div>


    10. Error Line 50, Column 1: XML Parsing Error: Extra content at the end of the document.

    </body>


  13. #13
    Candidat au Club
    Inscrit en
    Janvier 2008
    Messages
    15
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 15
    Points : 3
    Points
    3
    Par défaut
    Merci Bisûnûrs mais j'ai déjà essayé cette solution, et le résultat est le meme, mon menu disparait, comme le code javascript est intégré au HTML...


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    <div id="sommaire">
     
        <img src="images/images/cote_gauche.jpg" alt="" /><a href="histoire.html" onmouseover="document.histoire.src='images/survol/bouton1.jpg'" onmouseout="document.histoire.src='images/images/bouton1.jpg'"><img src="images/images/bouton1.jpg" name="histoire" alt="" /></a><a href="pirates.html" onmouseover="document.pirates.src='images/survol/bouton2.jpg'" onmouseout="document.pirates.src='images/images/bouton2.jpg'"><img src="images/images/bouton2.jpg" name="pirates" alt="" /></a><a href="rhum.html" onmouseover="document.rhum.src='images/survol/bouton3.jpg'" onmouseout="document.rhum.src='images/images/bouton3.jpg'"><img src="images/images/bouton3.jpg" name="rhum" alt=""  /></a><a href="cambuse.html" onmouseover="document.cambuse.src='images/survol/bouton4.jpg'" onmouseout="document.cambuse.src='images/images/bouton4.jpg'"><img src="images/images/bouton4.jpg" name="cambuse" alt=""  /></a><a href="navires.html"onmouseover="document.navires.src='images/survol/bouton5.jpg'" onmouseout="document.navires.src='images/images/bouton5.jpg'"><img src="images/images/bouton5.jpg" name="navires" alt="" /></a><a href="contact.html"onmouseover="document.contact.src='images/survol/bouton6.jpg'" onmouseout="document.contact.src='images/images/bouton6.jpg'"><img src="images/images/bouton6.jpg" name="contact" alt="" /></a><a href="contact.html" onmouseover="document.contact.src='images/survol/bouton6.jpg'" onmouseout="document.contact.src='images/images/bouton6.jpg'"><img src="images/images/cote_droit.jpg" alt="" class="menu"/></a><a href="pirates.html" onmouseover="document.pirates.src='images/survol/bouton2.jpg'" onmouseout="document.pirates.src='images/images/bouton2.jpg'"></a></div>

  14. #14
    Modérateur
    Avatar de Bisûnûrs
    Profil pro
    Développeur Web
    Inscrit en
    Janvier 2004
    Messages
    9 868
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Janvier 2004
    Messages : 9 868
    Points : 16 258
    Points
    16 258
    Par défaut
    Tu as deux fois l'id sommaire ...

    Pour rappel, un id est unique.

  15. #15
    Candidat au Club
    Inscrit en
    Janvier 2008
    Messages
    15
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 15
    Points : 3
    Points
    3
    Par défaut
    c'est une erreur de copier/coller sur le forum, dans mon code il ne l'est qu'une fois, le problème ne vient pas de là mais du code javascript qui est considéré dcomme une erreur par le validateur puisqu'il est intégré au HTML. j'aimerais savoir s'il est possible de les séparer, si oui, comment...

  16. #16
    Modérateur
    Avatar de Bisûnûrs
    Profil pro
    Développeur Web
    Inscrit en
    Janvier 2004
    Messages
    9 868
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Janvier 2004
    Messages : 9 868
    Points : 16 258
    Points
    16 258
    Par défaut
    Les événements Javascript comme ça ne posent aucun problème pour le validateur, tu dois avoir un soucis autre part.

    Vérifie par exemple que tu as bien un espace entre chaque attribut.

  17. #17
    Membre émérite Avatar de franculo_caoulene
    Profil pro
    Inscrit en
    Octobre 2003
    Messages
    2 880
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2003
    Messages : 2 880
    Points : 2 953
    Points
    2 953
    Par défaut
    Sur la toute première page Bisûnûrs et _Mac_ ont raison. Tu n'as pas besoin de toucher à ton javascript pour valider la page. J'ai déjà eu ce genre d'erreur due à javascript (que j'ai toujours de coté d'ailleurs faute de temps) d'où mes propositions mais dans ton cas un simple nettoyage de code suffit.
    Les Cours et tutoriels JavaScript
    Penser à la recherche et au bouton

  18. #18
    Rédacteur
    Avatar de _Mac_
    Profil pro
    Inscrit en
    Août 2005
    Messages
    9 601
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2005
    Messages : 9 601
    Points : 12 977
    Points
    12 977
    Par défaut
    Montre nous ton code, s'il te plait, en l'état, on ne peut pas dire grand-chose. Visiblement, il y a un pb dans l'ordre de tes balises ou alors une balise ouverte mais non fermée. Pour le moment, oublie le JavaScript, ne fait pas de fixation dessus : lis les messages renvoyés par le validator, il sont généralement assez explicites.

    Du détail, du détail, du détail !!!
    Revenons à la source : lisons la documentation et les fichiers de trace, la réponse à notre problème s'y trouve sans doute

  19. #19
    Candidat au Club
    Inscrit en
    Janvier 2008
    Messages
    15
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 15
    Points : 3
    Points
    3
    Par défaut
    voici mon code :

    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
     
     
    <!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" xml:lang="en">
     <head>
       <title>Les pirates</title>
       <meta http-equiv="content-type" content="text/html; charset=utf-8" />
       <link type="text/css" rel="stylesheet" href="style.css"/>
     
     </head>
     <body >
     
     <div id="page">
     
     
        <div id="header" >
     
     
    	</div>
     
     
     
    	  <div id="sommaire">
     
        <img src="images/images/cote_gauche.jpg" alt="" /><a href="histoire.html" onmouseover="document.histoire.src='images/survol/bouton1.jpg'" onmouseout="document.histoire.src='images/images/bouton1.jpg'"><img src="images/images/bouton1.jpg" name="histoire" alt="" /></a><a href="pirates.html" onmouseover="document.pirates.src='images/survol/bouton2.jpg'" onmouseout="document.pirates.src='images/images/bouton2.jpg'"><img src="images/images/bouton2.jpg" name="pirates" alt="" /></a><a href="rhum.html" onmouseover="document.rhum.src='images/survol/bouton3.jpg'" onmouseout="document.rhum.src='images/images/bouton3.jpg'"><img src="images/images/bouton3.jpg" name="rhum" alt=""  /></a><a href="cambuse.html" onmouseover="document.cambuse.src='images/survol/bouton4.jpg'" onmouseout="document.cambuse.src='images/images/bouton4.jpg'"><img src="images/images/bouton4.jpg" name="cambuse" alt=""  /></a><a href="navires.html"onmouseover="document.navires.src='images/survol/bouton5.jpg'" onmouseout="document.navires.src='images/images/bouton5.jpg'"><img src="images/images/bouton5.jpg" name="navires" alt="" /></a><a href="contact.html"onmouseover="document.contact.src='images/survol/bouton6.jpg'" onmouseout="document.contact.src='images/images/bouton6.jpg'"><img src="images/images/bouton6.jpg" name="contact" alt="" /></a><a href="contact.html" onmouseover="document.contact.src='images/survol/bouton6.jpg'" onmouseout="document.contact.src='images/images/bouton6.jpg'"><img src="images/images/cote_droit.jpg" alt="" class="menu"/></a><a href="pirates.html" onmouseover="document.pirates.src='images/survol/bouton2.jpg'" onmouseout="document.pirates.src='images/images/bouton2.jpg'"></a></div>
     
     
     
     
     
     
    	 <div id="contenu" >
     
    	 <div class="texte">
    	 <a href="index.html"><img src="images/carte_tresor.png" alt="" class="img_carte" /></a>
     
    	 <p class="titre">Un peu d'histoire</p><br/>
     
    	 Le mot pirate vient du mot grec πειρατης qui vient du verbe πειραω signifiant « s'efforcer de », « essayer de », « tenter sa chance à l'aventure ».<br/>
    	  <img src="images/histoire.jpg" alt="" width="300" height="200" class="img_navires" /><br/>
     
    	 	 Un pirate est une personne qui pratique la piraterie. La piraterie est la pratique, aussi vieille que la navigation, qui a pour objet l'attaque d'une embarcation dans le but de voler son chargement, et parfois le bateau tout entier. Cependant, les pirates ne se limitaient pas seulement aux autres bateaux mais parfois attaquaient des petites villes côtières. Le mot « pirate » est rattaché aux actions en mer sans l'aval d'une nation souveraine, contrairement aux corsaires, capitaines d'embarcation privée travaillant pour le compte d'une nation ou d'une personne importante dans la société. La piraterie maritime connut son apogée durant le XVIIIe siècle puis a peu à peu disparu, dû au pouvoir grandissant des nations sur toutes les régions du monde. Beaucoup d'anarchistes se sont inspiré de la philosophie des pirates qui consistait à s'exiler de toute nation afin de mener une vie plus libre.
     
    Malgré son origine maritime, le mot pirate est mentionné dans des contextes différents, tels que les « pirates de la route », que l'on appelait autrefois « voleurs de grand chemin ».	 </div>
     
     
    	</div>
     
     
     
      </div>
     </body>
    </html>

    et les erreurs que j'obtiens :

    # Line 23, Column > 80: XML Parsing Error: attributes construct error.

    …" alt="" /><a href="histoire.html" onmouseover="document.histoire.src='images…


    # Error Line 23, Column > 80: XML Parsing Error: Couldn't find end of Start Tag a line 23.

    …" alt="" /><a href="histoire.html" onmouseover="document.histoire.src='images…


    # Error Line 23, Column > 80: XML Parsing Error: Opening and ending tag mismatch: div line 21 and a.

    …" alt="" /><a href="histoire.html" onmouseover="document.histoire.src='images…


    # Error Line 23, Column > 80: XML Parsing Error: attributes construct error.

    …" alt="" /><a href="histoire.html" onmouseover="document.histoire.src='images…


    # Error Line 23, Column > 80: XML Parsing Error: Couldn't find end of Start Tag a line 23.

    …" alt="" /><a href="histoire.html" onmouseover="document.histoire.src='images…


    # Error Line 23, Column > 80: XML Parsing Error: Opening and ending tag mismatch: div line 11 and a.

    …" alt="" /><a href="histoire.html" onmouseover="document.histoire.src='images…


    # Error Line 23, Column > 80: XML Parsing Error: Opening and ending tag mismatch: body line 9 and div.

    …" alt="" /><a href="histoire.html" onmouseover="document.histoire.src='images…


    # Error Line 48, Column 8: XML Parsing Error: Opening and ending tag mismatch: html line 2 and div.

    </div>


    # Error Line 49, Column 1: XML Parsing Error: Extra content at the end of the document.

    </body>

  20. #20
    Membre émérite Avatar de franculo_caoulene
    Profil pro
    Inscrit en
    Octobre 2003
    Messages
    2 880
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2003
    Messages : 2 880
    Points : 2 953
    Points
    2 953
    Par défaut
    Citation Envoyé par _Mac_ Voir le message
    et un attribut name en trop dans une balise <img>.
    Les Cours et tutoriels JavaScript
    Penser à la recherche et au bouton

+ Répondre à la discussion
Cette discussion est résolue.
Page 1 sur 2 12 DernièreDernière

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] Validation W3C : problème avec le javascript
    Par jason69 dans le forum Balisage (X)HTML et validation W3C
    Réponses: 4
    Dernier message: 07/08/2007, 10h38
  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
  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