5568 sujets

Sémantique web et HTML

Bonjour à tous,

J'ai un souci avec un bout de code javascript qui m'empêche de valider une page.
J'ai ajouté des commentaires comme ceci:


<script type="text/javascript">
<!--
function bidule(param)
	{.............}
// -->
</script>


Mais on vient toujours me chercher des poux dans mon javascript,
quelqu'un aurai une idée?

Merci d'avance !
Modifié par HoIP (27 Feb 2008 - 17:20)
Est-ce que tu es en XHTML ou en HTML? Dans le premier cas, le script doit être inclus dans une section CDATA:

<![CDATA[
(le code javascript)
]]>
Merci Gilles, j'ai essayé de ces deux manières et toujours le même pb.
<script type="text/javascript">
<![CDATA[
function create_frp()
	{...}
]]>
</script>
<script type="text/javascript">
//<![CDATA[
function create_frp()
	{...}
//]]>
</script>
Pour info voila mon type de doc :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
      "http://www.w3.org/TR/html4/loose.dtd">


J'oubliais, mon javascript est dans le <HEAD>, cela change t-il quelque chose?
Modifié par HoIP (27 Feb 2008 - 17:58)
Visiblement, tu n'es pas en XHTML, donc la mise en commentaires comme tu l'as fait ne devrait pas poser de problème. L'erreur vient peut-être de ce qu'il y a en amont du script.

Pourrais-tu nous recopier le message d'erreur du validateur ainsi que ton head?

Si tu pouvais indiquer une URL où nous pourrions regarder, ce serait encore mieux d'ailleurs Smiley cligne
Voilà, j'espère que ça te va...
Merci pour ton aide

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
      "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<link rel="stylesheet" href="../../inc/css/form.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../inc/css/style.css" type="text/css" media="screen">
<title>Device properties</title>

<script type="text/javascript">
//<![CDATA[
function create_champ(i)
	{var i2 = i + 1;
	 document.getElementById('input_'+i).innerHTML = '<table class="eval_bitrate"><tr><td>Packet size</td><td><input class="etroit input_bitrate_idp" type="text" name="packet_size[]">KB</td><td>  Bitrate</td><td><input class="etroit input_bitrate2_idp" name="bitrate_eval[]" type="text"/> Mbps</td></tr>';
	 document.getElementById('input_'+i).innerHTML += (i <= 10000) ? '</table><span id="input_'+i2+'"><input type="button" onClick="javascript:create_champ('+i2+')" value="Add"></span>' : '';
	}
//]]>
</script>
</head>
<body>


a écrit :

Validation Output: 8 Errors

1. Error Line 14, Column 102: end tag for element "TD" which is not open.

…eval_bitrate"><tr><td>Packet size</td><td><input class="etroit input_bitrate_

&#9993;

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 occurred in a script section of your document, you should probably read this FAQ entry.
2. Error Line 14, Column 185: end tag for element "TD" which is not open.

…pe="text" name="packet_size[]">KB</td><td> Bitrate</td><td><input

&#9993;

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 occurred in a script section of your document, you should probably read this FAQ entry.
3. Error Line 14, Column 213: end tag for element "TD" which is not open.

…]">KB</td><td> Bitrate</td><td><input class="etroit input_bitrate2

&#9993;

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 occurred in a script section of your document, you should probably read this FAQ entry.
4. Error Line 14, Column 302: end tag for element "TD" which is not open.

…itrate_eval[]" type="text"/> Mbps</td></tr>';

&#9993;

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 occurred in a script section of your document, you should probably read this FAQ entry.
5. Error Line 14, Column 307: end tag for element "TR" which is not open.

…e_eval[]" type="text"/> Mbps</td></tr>';

&#9993;

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 occurred in a script section of your document, you should probably read this FAQ entry.
6. Error Line 15, Column 74: end tag for element "TABLE" which is not open.

….innerHTML += (i <= 10000) ? '</table><span id="input_'+i2+'"><input type="bu

&#9993;

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 occurred in a script section of your document, you should probably read this FAQ entry.
7. Error Line 15, Column 180: end tag for element "SPAN" which is not open.

…ate_champ('+i2+')" value="Add"></span>' : '';

&#9993;

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 occurred in a script section of your document, you should probably read this FAQ entry.
Bonjour,

Hé, vous savez quoi?
Non?
Ben la FAQ du forum parle de ce problème.
Si si.

Smiley smile
Modifié par Florent V. (27 Feb 2008 - 19:03)
Gilles a écrit :
Visiblement, tu n'es pas en XHTML, donc la mise en commentaires comme tu l'as fait ne devrait pas poser de problème.

Ni même en XHTML 1.0 servi en "text/html" (comme dans 99% des cas). À moins qu'on ne fasse du "text/html" en attendant de pouvoir servir le même document en "application/xhtml+xml".
Modifié par Florent V. (27 Feb 2008 - 19:06)