Autor Zpráva
MilanJ
Profil
Vím, že validní stránka není dogma, nicméně se sluší a patří, aby se držela určitých pravidel. Už od začátku tvorby stránky se snažím o validní kód a tak si ho nechávám průběžně zkontrolovat validátorem.
Jaké však bylo moje překvapení, když se objevila chybička hned na začátku, a to po vložení flash soboru.
Stránka do téhle chvíle validní již validní není a mě nenapadá, proč by validní být neměla.

Na stránce mám následující DOCTYPE:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

...a tady obsah BODY:


<div id="container">
<div id="container-horizontal">
<div id="container-in">
<embed src="images/banner.swf" width="954" height="150"></embed>
</div>
</div>
</div>


Kde dělám chybu, že mi validátor píše:


This page is not Valid HTML 4.01 Transitional!
Below are the results of attempting to parse this document with an SGML parser.

Error Line 24 column 13: there is no attribute "SRC".
<embed src="images/banner.swf" width="954" height="150"></embed>
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.



Error Line 24 column 39: there is no attribute "WIDTH".
<embed src="images/banner.swf" width="954" height="150"></embed>


Error Line 24 column 52: there is no attribute "HEIGHT".
<embed src="images/banner.swf" width="954" height="150"></embed>


Error Line 24 column 57: element "EMBED" undefined.
<embed src="images/banner.swf" width="954" height="150"></embed>
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.
MilanJ
Profil
Použít jiný DOCTYPE? Zkoušel jsem, bez výsledků.
Suji
Profil
Ja osobne delam dokument validni pokud je bez flashe. Kdyz tam flash mam, delam ho validni krome flashe. Rad se necham poucit, ale ja zatim na validni a zaroven 100% fungujici zpusob neprisel.
Chamurappi
Profil
Reaguji na MilanaJ:
Nevalidita není chyba. Validátor tě pouze upozorňuje na nesoulad s definicí typu dokumentu, nic víc. Důvody, proč je ta či ona nevalidní věc špatná (či jen „špatná“), jsou různé. V tomto případě je <embed> špatný hlavně proto, protože na něj konsorcium záměrně zapomnělo. Na tvém místě bych to neřešil.

Existují funkční a validní postupy vložení Flashe, ale jsou dost ukecané a nevěřím příliš v jejich spolehlivost.
Suji
Profil
tak jsem trosku hledal a
http://www.ovsem.net/webdesign/jak-mit-validni-flash-xhtml-1.0-transit ional
http://www.dgx.cz/trine/item/jak-spravne-vlozit-flash-do-stranky
http://interval.cz/clanky/flash-a-nahrada-elementu-embed-elementem-obj ect-v-xhtml/
treba ti to pomuze
MilanJ
Profil
Suji
Moc díky za linky, zejména www.dgx.cz/trine/item/jak-spravne-vlozit-flash-do-stranky mi pomohl...stránka je validní.

Díky i Tobě Chamurappi, validátor sice je někdy dobrý rádce, ale vždycky špatný pán.:-)
Toto téma je uzamčeno. Odpověď nelze zaslat.

0