Partage
  • Partager sur Facebook
  • Partager sur Twitter

iti problemme pour du js dans du xhtm valide

Sujet résolu
    21 février 2006 à 20:18:27

    bonjour j'ai un petit problemme avec l'integration du de js dans ma page xhtml le validateur w3c me revoi une ereur et je ne la comprend pas pouver vous m'aider
    alors le code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
    <head>
            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
            <title>le site officiel de la Shinra</title>
            <link rel="shortcut icon" href="favicon.ico" />
            <meta name="author" content="Yann Asset" />
            <link href="style.css" rel="stylesheet" media="screen" />
    </head>
    <body>
    <p id="tete">

    <span id="compteur">
    <img src="http://perso0.free.fr/cgi-bin/wwwcount.cgi?df=webshinra.dat&amp;ft=0&amp;dd=7seg" title="" alt="" />
    </span>
    <span id="sigle">
    <img src="design/sigletournant.gif" title="" alt="" /><img src="design/image_logo_shinra/shinra5.jpg"alt="shinra" /><img src="design/sigletournant.gif" title="" alt="" />
    </span>
    </p>
    <p id="menu">
    <a href="index.php?page=home">accueil</a>
    <br />
    <a href="index.php?page=news">Les News</a>
    <br />
    <a href="index.php?page=galerie">Galerie</a>
    <br />

    <a href="index.php?page=Projet_Pyro">Projet Pyro</a>
    <br />
    <a href="index.php?page=utilitaire">Utilitaire</a>
    <br />
    <a href="index.php?page=mail">Contact</a>
    <br />
    <a href="forum/index.php">Forum</a>
    <br />
    <a href="index.php?page=lien">Les liens</a>
    <br />
    </p>
    <div id="corps">

                                    <h5>Calcul du PGCD</h5>
                                    <script language="JavaScript">
                                   
                                    function pgcd()
                                    {
                                    d=0;
                                    document.getElementById("l_r").value = "";
                                    //document.pgcd_f.etapes.value="";
                                    a=Math.max(document.getElementById("nb_a").value,document.getElementById("nb_b").value);
                                    b=Math.min(document.getElementById("nb_a").value,document.getElementById("nb_b").value);
                                            while (b!=0)
                                            {
                                            t_a=a;
                                            a=Math.min(a,b);
                                            d=b;
                                            b=t_a%b;
                                            document.getElementById("l_r").value += 'PGCD('+t_a+' ; '+d+') = PGCD('+a+' ; '+b+') car '+t_a+' = '+d+' x '+Math.floor(t_a/d)+' + '+b+'\n';
                                            }
                                    document.getElementById("resultat").value = d;
                                    }
                                    </script>
                                    <form action="index.php" method="post" id="pgcd_f">
                                            <table class="tab">
                                                    <tr>
                                                            <th>
                                                                    Nombre x
                                                            </th>

                                                            <th>
                                                                    Nombre y
                                                            </th>
                                                    </tr>
                                                    <tr>
                                                            <td>
                                                                    <div class="center">
                                                                            <input name="nb_a" value="124053" maxlength="40" style="width: 98%;" id="nb_a" />
                                                                    </div>

                                                            </td>
                                                            <td>
                                                                    <div class="center">
                                                                            <input name="nb_b" value="3915" maxlength="40" style="width: 98%;" id="nb_b" />
                                                                    </div>
                                                            </td>
                                                    </tr>
                                                    <tr>
                                                            <th colspan="2">

                                                                    Calculer
                                                            </th>
                                                    </tr>
                                                    <tr>
                                                            <td colspan="2">
                                                                    <div class="center">
                                                                            <input value="Calculer" onclick="pgcd();" type="button" style="width: 98%;" />
                                                                    </div>
                                                            </td>

                                                    </tr>
                                                    <tr>
                                                            <td colspan="2">
                                                                    <div class="center">
                                                                            <textarea name="etapes" cols="40" rows="10" style="width: 98%;" id="l_r"></textarea>
                                                                    </div>
                                                            </td>
                                                    </tr>

                                                    <tr>
                                                            <th colspan="2">
                                                                    Resultat
                                                            </th>
                                                    </tr>
                                                    <tr>
                                                            <td colspan="2">
                                                                    <input name="nb_pgcd" type="text" value="pgcd:(x;y)" maxlength="40" style="width: 98%;" id="resultat" />
                                                            </td>

                                                    </tr>
                                            </table>
                                    </form>
                                    <p>
                                            <a href="index.php?page=utilitaire">Revenir à l'utilitaire.</a>
                                    </p></div>
    </body>
    </html>

    et le validateur w3c me revoi sa:
    # Error Line 42 column 21: 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.

    &#9993;
    # Error Line 42 column 33: 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>.

    • Partager sur Facebook
    • Partager sur Twitter
      21 février 2006 à 20:21:00

      Salut,

      A la place de ton
      <script language="JavaScript">
      mets
      <script type="text/javascript">


      Je pense que çà vient de là
      • Partager sur Facebook
      • Partager sur Twitter
        21 février 2006 à 20:30:40

        Citation

        # Error Line 42 column 33: 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>.



        N'empêche que le validateur est assez clair...
        Si c'est l'anglais qui te rebute, tu as aussi des validateurs en français.
        • Partager sur Facebook
        • Partager sur Twitter
          21 février 2006 à 20:37:56

          c'etais bien cela qui posai problemme merci du font du coeur (en plus je le pence [je suis parfoi execif mais c'est toujours mieu dans se sens la ^^])
          "N'empêche que le validateur est assez clair... "

          j'ai 'impression que c'est le rouge qui me fait paniquer sinon des validateur en françai j'en ai pas vue des officiel... (mais je me trompe sans doute)
          • Partager sur Facebook
          • Partager sur Twitter

          iti problemme pour du js dans du xhtm valide

          × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
          × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
          • Editeur
          • Markdown