Rifts Posted November 30, 2010 Share Posted November 30, 2010 Hey everyone, trying to get my site to validate as XHTML 1.0 Transitional. Getting this problem have no idea how I can fix it. document type does not allow element "b" here <script type="text/javascript"> var test=new Array(); test[0]='<b><u><?= $title2;?></u></b><br>'; Thanks Link to comment https://forums.phpfreaks.com/topic/220262-problem-with-validating-htmlphp-inside-javascript/ Share on other sites More sharing options...
BlueSkyIS Posted November 30, 2010 Share Posted November 30, 2010 maybe try converting special html chars to their html equivalents, for example change < to < Link to comment https://forums.phpfreaks.com/topic/220262-problem-with-validating-htmlphp-inside-javascript/#findComment-1141454 Share on other sites More sharing options...
Rifts Posted November 30, 2010 Author Share Posted November 30, 2010 didnt help Link to comment https://forums.phpfreaks.com/topic/220262-problem-with-validating-htmlphp-inside-javascript/#findComment-1141458 Share on other sites More sharing options...
Adam Posted December 1, 2010 Share Posted December 1, 2010 Add HTML comments around your JavaScript: <script type="text/javascript"> <!-- // ... --> </script> That will cause the validator to ignore any mark-up it finds. Link to comment https://forums.phpfreaks.com/topic/220262-problem-with-validating-htmlphp-inside-javascript/#findComment-1141580 Share on other sites More sharing options...
Rifts Posted December 1, 2010 Author Share Posted December 1, 2010 I love you! that worked perfectly Link to comment https://forums.phpfreaks.com/topic/220262-problem-with-validating-htmlphp-inside-javascript/#findComment-1141907 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.