Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Prośba o pomoc (validacja)
Forum PHP.pl > Forum > Przedszkole
-tomek-
Mam problem z validatorem
W nizej zamieszczonym kodzie wyskakuje mi bląd podczas validacji? Proszę o pomoc jak go skorygować?


Błąd brzmi:
Line 9, Column 47: there is no attribute "language".

<script type="text/javascript" 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. 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.


  1. <?xml version="1.0" encoding="iso-8859-2"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl-PL" lang="pl-PL">
  4. <title>Krzyż</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
  6. <link rel="stylesheet" href="styl1.css" type="text/css" />
  7. <link rel="shortcut icon" href="logo.ico" />
  8. <script type="text/javascript" language="JavaScript">
  9. var stan;
  10. function PokazUkryj(nazwa) {
  11. stan=(document.getElementById(nazwa).style.display=="none")?true:false;
  12. document.getElementById(nazwa).style.display=(stan)?"block":"none";
  13. }
  14.  
  15. </head>
  16.  
  17. <div id="glowny">
  18. <div id="przedglowek">
  19.  
  20. </div>
  21. <div id="naglowek">
  22. </div>
  23.  
  24. <div id="podglowek">
  25.  
  26. </div>
  27.  
  28. <div id="menu">
  29. <a href="javascript:PokazUkryj('spis');" style="margin-left:20px">Pokaż/ukryj menu</a>
  30. <div id="spis">
  31. <?php include("menu.php"); ?>
  32.  
  33. </div></div>
  34.  
  35. <div id="prosta">
  36.  
  37. </div>
  38.  
  39. <div id="tresc">
  40. <?php include("main.php"); ?>
  41.  
  42. </div>
  43. <div id="stopka">
  44. <span class="foot" style="float: left"><a href="http://validator.w3.org/check/referer">Standard XHTML</a>  <a href="http://jigsaw.w3.org/css-validator/">Standard CSS</a></span>
  45. <span class="foot" style="float: right">Copyright &reg; 2008 by Tomasz Abramski. All rights reserved.</span>
  46.  
  47. </div>
  48. </div>
  49. </body>
  50. </html>
sniezny_wilk
Kod poprawny:

  1. <?xml version="1.0" encoding="iso-8859-2"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl-PL" lang="pl-PL">
  4. <title>Krzyż</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
  6. <link rel="stylesheet" href="styl1.css" type="text/css" />
  7. <link rel="shortcut icon" href="logo.ico" />
  8. <script type="text/javascript">
  9. var stan;
  10. function PokazUkryj(nazwa) {
  11. stan=(document.getElementById(nazwa).style.display=="none")?true:false;
  12. document.getElementById(nazwa).style.display=(stan)?"block":"none";
  13. }
  14.  
  15. </head>
  16.  
  17. <div id="glowny">
  18. <div id="przedglowek">
  19.  
  20. </div>
  21. <div id="naglowek">
  22. </div>
  23.  
  24. <div id="podglowek">
  25.  
  26. </div>
  27.  
  28. <div id="menu">
  29. <a href="javascript:PokazUkryj('spis');" style="margin-left:20px">Pokaż/ukryj menu</a>
  30. <div id="spis">
  31. <?php include("menu.php"); ?>
  32.  
  33. </div></div>
  34.  
  35. <div id="prosta">
  36.  
  37. </div>
  38.  
  39. <div id="tresc">
  40. <?php include("main.php"); ?>
  41.  
  42. </div>
  43. <div id="stopka">
  44. <span class="foot" style="float: left"><a href="http://validator.w3.org/check/referer">Standard XHTML</a> <a href="http://jigsaw.w3.org/css-validator/">Standard CSS</a></span>
  45. <span class="foot" style="float: right">Copyright &reg; 2008 by Tomasz Abramski. All rights reserved.</span>
  46.  
  47. </div>
  48. </div>
  49. </body>
  50. </html>


Nie potrzebnie dałeś:

  1. language="JavaScript"


niepotrzebny atrybut.
-tomek-
Dzieki wielkie
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.