W3C home > Mailing lists > Public > www-validator@w3.org > July 2013

embedded end tag errors

From: Ken Jones <drkenjones1@earthlink.net>
Date: Thu, 11 Jul 2013 12:38:31 -0400
Message-Id: <C1549DAE-7308-42EB-8126-823AB44BE84C@earthlink.net>
To: www-validator@w3.org
Here's an issue that arose for me. When an end tag such as </style> or </a> is found in an embedded usage, as below, it flags it as an error because it found an unattached tag.

<script type="text/javascript">
if (isTouchDevice()) {
document.write( "<style type='text/css'>");
..... some stuff in here ...
document.write( '</style>");  // this flags an error
};
</script>


I can get around it by using the following hack 

<script type="text/javascript">
if (isTouchDevice()) {
document.write( "<style type='text/css'>");
..... some stuff in here ...
document.write( '<' + "/style>"); // this now works, and the page is completely functional
};
</script>


Thanks for the great validation service. I tried to donate, but ran into some odd currency issues. 
Ken
Received on Friday, 12 July 2013 06:47:16 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:18:08 UTC