Erreur W3C

WRInaute accro
Je suis en train d'apporter la touche finale à mon dernier bébé.
Et vu l'état pitoyable de mon anglais, je ne comprends pas ce que me veut ce satané validateur :mrgreen:

# Error Line 77 column 92: document type does not allow element "link" here.

...css/adsmanager.css" type="text/css" />

The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).


# Error Line 89 column 31: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified.

<div align='center'><a href=http://www.example.fr/annonce,photo/page,sh


# Error Line 89 column 37: NET-enabling start-tag not immediately followed by null end-tag.

<div align='center'><a href=http://www.example.fr/annonce,photo/page,sh

This error may occur when there is a mistake in how a self-closing tag is closed, e.g '.../ >'. The proper syntax is '... />' (note the position of the space).


# Error Line 89 column 183: value of attribute "align" cannot be "center"; must be one of "top", "middle", "bottom", "left", "right".

...smanager/ads/11a_t.jpg' align='center' border='0' alt='' /></a><br /><br />

The value of the attribute is defined to be one of a list of possible values but in the document it contained something that is not allowed for that type of attribute. For instance, the “selected” attribute must be either minimized as “selected” or spelled out in full as “selected="selected"”; a value like “selected="true"” is not allowed.


# Error Line 89 column 208: end tag for element "a" which is not open.

...lign='center' border='0' alt='' /></a><br /><br />

The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem.

If this error occured in a script section of your document, you should probably read this FAQ entry.


# Error Line 90 column 11: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified.

<a href=http://www.example.fr/annonce,photo/page,show_ad/adid,11/>Olymp


# Error Line 90 column 17: NET-enabling start-tag not immediately followed by null end-tag.

<a href=http://www.example.fr/annonce,photo/page,show_ad/adid,11/>Olymp


# Error Line 90 column 85: end tag for element "a" which is not open.

...hoto/page,show_ad/adid,11/>Olympus</a></div> </td>


# Error Line 646 column 11: document type does not allow element "noscript" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag.

<noscript>

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
 
WRInaute accro
tu dois traiter les erreurs une par une, de la premiere à la derniere.

il te dis donc : "document type does not allow element "link" here."

je dirai que ta balise link est mal placé. tu ne l'aurais pas mis dans le <body> ?

l'url serait plus simple pour voir le problème


pour les autres erreurs, je vois déjà que :
- tu n'a pas mis de ' ou " pour "encadrer" tes liens
- tu utilises align='center' alors que ce n est plus permis (style='text-align:center'>
 
WRInaute accro
e-kiwi a dit:
tu dois traiter les erreurs une par une, de la premiere à la derniere.

il te dis donc : "document type does not allow element "link" here."

je dirai que ta balise link est mal placé. tu ne l'aurais pas mis dans le <body> ?

l'url serait plus simple pour voir le problème


pour les autres erreurs, je vois déjà que :
- tu n'a pas mis de ' ou " pour "encadrer" tes liens
- tu utilises align='center' alors que ce n est plus permis (style='text-align:center'>
Le lien c'est pour bientôt mais dans l'immédiat, je dois vaquer à d’autres occupations.
Mais je referais de nouveau appel à tes compétences sitôt prêt :wink:
Merci
 
WRInaute discret
Salut

Déjà il faut <a href=" avec ouverture et fermeture de guillemets !

avec ça cela devrait être pas mal nettoyé.

Ed
 
WRInaute passionné
salva a dit:
Et vu l'état pitoyable de mon anglais, je ne comprends pas ce que me veut ce satané validateur :mrgreen:
Si tu n'es pas à l'aise avec le validateur dans la langue de Shakespeare, utilise celui dans la langue de Molière : Validome :wink:
 
WRInaute accro
Merci, il me sera utile :)

Il me reste les deux erreurs ci-dessous:

La première concerne la balise "link" qui est bien placée dans le body comme souligné par e-kiwi.
Elle est introduite dans le body par un composant externe.

Code:
	function lastAds($ads,$option,$itemid) {
		global $mosConfig_live_site,$mosConfig_absolute_path;
	?>
		<h1 class="contentheading"><? echo ADSMANAGER_LAST_ADS;?></h1>

		<div class='adsmanager_box'>

		<table class='adsmanager_inner_box' width="100%">

		<tr style="text-align: center;">

		<?
		if (isset($ads)) {
		foreach($ads as $row) {

		?>

			<td>

			<?		$a_pic = $mosConfig_absolute_path."/images/$option/ads/".$row->id."a_t.jpg";

					

					$b_pic = $mosConfig_absolute_path."/images/$option/ads/".$row->id."b_t.jpg";

					

					$linkTarget = sefRelToAbs("index.php?option=$option&page=show_ad&adid=".$row->id."&Itemid=".$itemid);

							

					if ( file_exists( $a_pic)) {

						echo "<div style='text-align: center;'><a href='$linkTarget'>";

						echo "<img src='".$mosConfig_live_site."/images/$option/ads/".$row->id."a_t.jpg' style='text-align: center;' border='0' alt='' />";

						echo "</a>"; 

						echo "<br />";

						echo "<br />";

					}

					else if ( file_exists( $b_pic)) {

						echo "<div style='text-align: center;'><a href='$linkTarget'>";

						echo "<img src='".$mosConfig_live_site."/images/$option/ads/".$row->id."b_t.jpg' style='text-align: center;' border='0' alt='' />";

						echo "</a>"; 

						echo "<br />";

						echo "<br />";

					 }

					 else {

						echo "<div style='text-align: center;'><a href='$linkTarget'>";
						
						if ((ADSMANAGER_NOPIC != "")&&(file_exists($mosConfig_absolute_path."/components/$option/images/".ADSMANAGER_NOPIC)))
							echo "<img src='".$mosConfig_live_site."/components/$option/images/".ADSMANAGER_NOPIC."' style='text-align: center;' border='0' alt='' />";
						else
							echo "<img src='".$mosConfig_live_site."/components/$option/images/nopic.gif' style='text-align: center;' border='0' alt='' />";

						echo "</a>"; 

						echo "<br />";

						echo "<br />";

					 }

			?>

			<? echo "<a href='$linkTarget'>".stripslashes($row->ad_headline)."</a></div>"; ?>
			</td>

		<?

		}
	}

	?>

	  </tr>

	</table>

Pour la seconde, il s'agit du "noscript" du marqueur xiti.

# Error Line 77 column 92: document type does not allow element "link" here.

...css/adsmanager.css" type="text/css" />

The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).
# Error Line 646 column 11: document type does not allow element "noscript" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag.

<noscript>

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
 
WRInaute impliqué
Euh dans le code que tu cite, je ne vois pas ou est inséré ta balise link....

et dans tous les cas, qu'est-ce qui t'empeche de déplacer ton code dans le head ?
 
WRInaute accro
NxtGen a dit:
Euh dans le code que tu cite, je ne vois pas ou est inséré ta balise link....

et dans tous les cas, qu'est-ce qui t'empeche de déplacer ton code dans le head ?
la balise:
<? echo "<a href='$linkTarget'>".stripslashes($row->ad_headline)."</a></div>"; ?>

Si je la déplace dans le head elle reste quand même affichée dans la table.
Ou alors je m'y prends comme une branche mais les fonctions et moi...no comment
 
WRInaute impliqué
ca n'a rien a voir avec ton erreur cette ligne

dans ta source tu a la ligne
<link rel="stylesheet" href="components/com_adsmanager/css/adsmanager.css" type="text/css" />

D'ou elle sort ? (pas du code cité en tout cas)
 
WRInaute accro
J'ai l'impression que vous ne cernez pas réellement le problème :)
Où alors c'est moi :?
Cette ligne:
<link rel="stylesheet" href="components/com_adsmanager/css/adsmanager.css" type="text/css" />

est affichée à cet endroit précis du body par celle-ci (me semble t-il):
<? echo "<a href='$linkTarget'>".stripslashes($row->ad_headline)."</a></div>"; ?>

Issue de la fonction citée plus haut.
 
WRInaute accro
un echo "<a href=''>...</a>" ne peut pas voir comme résultat <link rel="...">

sans avoir le code sous les yeux, cela tombe sous le sens ! donc ta balise <link> doit se trouver ailleurs
 
WRInaute accro
J'ai beau chercher le lien sous cette forme
<link rel="stylesheet" href="components/com_adsmanager/css/adsmanager.css" type="text/css" />

Je ne le trouve pas :?
 
WRInaute accro
Bingo!

Quelle bille :oops:
Mal cherché :mrgreen:

Merci Szarah et merci e-kiwi ainsi qu'à tous les participants à ce post.
:D
 
WRInaute accro
attention, des fois on croit qu'il restai qu'une erreur w3c, mais une fois l'erreur corrigée, d'autres apparaissent :)
 
Nouveau WRInaute
Salut,

Je suis l'auteur du module adsmanager que tu utilises dans la derniere version, j'ai corrigé la quasi totalité des erreurs W3C.
feuiille de style dans le header, valise img, valise input,etc ..

Par contre il reste des erreurs dans le formulaire.
En fait j'ai rajouté un parameter au balises input (parameter qui n'est pas standard, et que j'utilise ensuite dans du javascript).
Y'a t'il un autre moyen pour ajouter un parameter a une balise sans erreur W3C. Le but etant pour moi de differencie une balise input obligatoire et une balise input optionel (et de checker dans le javascript que l'input est bien rempli si obligatoire)
 
Discussions similaires
Haut