Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [xHTML]Poprawność kodu
Forum PHP.pl > Forum > Przedszkole
adrianozo
Witam.
Postanowiłem sprawdzić kod xHTML w walidatorze. Wyskoczyły mi 2 błędy tej samej treści tylko w innych linijkach.
Treść błędów:

1.
Kod
Warning DOCTYPE Override in effect!

The detected DOCTYPE Declaration "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">" has been suppressed and the DOCTYPE for "XHTML 1.0 Transitional" inserted instead, but even if no errors are shown below the document will not be Valid until you update it to reflect this new DOCTYPE.


2.
Kod
Info Using Direct Input mode: UTF-8 character encoding assumed

Unlike the "by URI" and "by File Upload" modes, the "Direct Input" mode of the validator provides validated content in the form of characters pasted or typed in the validator's form field. This will automatically make the data UTF-8, and therefore the validator does not need to determine the character encoding of your document, and will ignore any charset information specified.

If you notice a discrepancy in detected character encoding between the the ?Direct Input? mode and other validator modes, this is likely to be the reason. It is neither a bug in the validator, nor in your document.


Nie za bardzo wiem o co chodzi. Jeśli mógłby ktoś pomóc byłbym bardzo wdzięczny smile.gif

EDIT:

Ustawiając ENCODING i DOCTYPE na automatyczne wyrzuca tylko błąd nr 2

Kod
Info Using Direct Input mode: UTF-8 character encoding assumed

Unlike the "by URI" and "by File Upload" modes, the "Direct Input" mode of the validator provides validated content in the form of characters pasted or typed in the validators form field. This will automatically make the data UTF-8, and therefore the validator does not need to determine the character encoding of your document, and will ignore any charset information specified.

If you notice a discrepancy in detected character encoding between the the ?Direct Input? mode and other validator modes, this is likely to be the reason. It is neither a bug in the validator, nor in your document.
Meares
Na początku każdego dokumentu HTML musi byc zamieszczony jego "doctype".
Ramy dokumentu - www.kurshtml.boo.pl
adrianozo
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Takie coś mam smile.gif
Gryf
z tych sprawdź czy plik na pewno jest kodowany w UTF-8 oraz DOCKTYPE <- jaki masz?
adrianozo
Nie rozumiem twojej wypowiedzi Gryf.
Mógłbyś jaśniej?
Meares
  1. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
Masz takie coś w kodzie?
adrianozo
Takie coś

  1. <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
Meares
Powinno być "Content-Type", a nie "Content-type". winksmiley.jpg Wielkość ma znaczenie. tongue.gif
adrianozo
Poprawione, ale ostrzeżenie dalej wyskakuje
wiewiorek
Meareas może nie w temacie, ale mógłbyś zacząć używać UTF-8 tongue.gif
Adrianozo wklej tu całą sekcję <head>.
Meares
Używam, ale nie chciało mi się tego zmieniać. (Linijkę przekopiowałem w kurshtaml.boo.pl zwyczajnie) tongue.gif
adrianozo
  1. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  2. <meta http-equiv="Content-Language" content="pl" />
  3. <title>MEDBook Store</title>
  4. <link rel="stylesheet" type="text/css"
  5. media="all" href="style.css" />
  6. </head>
Meares
Zapomniałem. haha.gif Na samym początku dokumentu xHTML musisz mieć następującą linijkę:
  1. <?xml version="1.0" encoding="utf-8" ?>


EDIT: I teraz widzimy, że nawet na www.kurshtml.boo.pl są małe błędy. winksmiley.jpg
adrianozo
Oto jest od początku smile.gif
  1. <?xml version="1.0" encoding="utf-8"?>
potreb
To info które wkleiłeś to nie żaden błąd tylko informacja o walidacji.
Meares
Kuźwa... Już wiem gdzie jest problem. -.-' Problemem jest to, że walidujesz ten kod metodą "Direct Input", czyli wklejeniem kodu na W3C Validator. Jeśli zapiszesz plik i użyjesz metody File Upload, nic nie powinno wyskoczyć (jeśli oczywiście reszta pliku jest poprawna).
adrianozo
Nie mogę przez File Upload ponieważ większość w skrypcie to PHP i wyrzuca błędy z nim związane smile.gif
Meares
To wrzuć na serwer i poprzez "via URI".
l0ud
Wywal tą linię z <?xml na początku, tego ma nie być.

Zainstaluj ten dodatek: https://addons.mozilla.org/pl/firefox/addon/60 i waliduj poprzez Narzędzia -> Sprawdź poprawność lokalnego pliku HTML smile.gif
adrianozo
Cytat(Meares @ 18.11.2009, 20:39:28 ) *
To wrzuć na serwer i poprzez "via URI".


Tak samo jak z File Upload
erix
To nie jest błąd, tylko informacja... Nie traktuj jej jako wiążącej odnośnie poprawności kodu XHTML. winksmiley.jpg
adrianozo
Dzięki... Żyłbym w przekonaniu, że psuje to kod smile.gif
POMÓGŁ
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.