Si realmente está atrapado con algún fragmento de HTML (preprocesado en alguna fuente no controlable) que contiene comentarios, y necesita asegurarse de que no se represente en su página, siempre puede envolverlo con un script
etiqueta como a continuación, lo único es que no puede comentar script
etiquetas de esta manera.
<html>
<head>
</head>
<body>
<!-- multiline "comment" below using script type="text/html" -->
<script type="text/html">
Hello world!
<!-- Look at me, I'm a comment :) -->
<div>Yeah, whatever, I'm an element..</div>
</script>
<span>Who cares, span is the man, the only visible one anyway!</span>
</body>
</html>
Si necesita crear un comentario en script
etiquetas, se puede utilizar un textarea
como envoltorio lugar, por supuesto hacerlo de esta manera, no se puede comentar textarea
etiquetas.
<html>
<head>
</head>
<body>
<!-- multiline "comment" below using textarea style="display:none;" -->
<textarea style="display:none;"> \t
<script>
alert("which won't show up..");
</script>
Hello world!
<!-- Look at me, I'm a comment :) -->
<div>Yeah, whatever, I'm an element..</div>
</textarea>
<span>Who cares, span is the man, the only visible one anyway!</span>
</body>
</html>
UH, en realidad? ¿Soy el único agravado por esto? o.O Gracias por el consejo php ... –
Es aún peor en CSS :) –