0

I have an embedded map on a page. It won't W3C validate due to unencoded ampersands in the url for a marker. If I encode the & as & then it validates but the marker doesn't show up. Is there a solution for this dilemma? I've seen other people that also have this problem, but I not seen any solutions.

geocodezip
  • 158,664
  • 13
  • 220
  • 245

1 Answers1

0

The problem is the W3C validator attempting to validate javascript as HTML

Wrap your script in

<script type="text/javascript">
//<![CDATA[


//]]>
</script>

If I do that with your code, the page validates

geocodezip
  • 158,664
  • 13
  • 220
  • 245
  • That's exactly why I hate the W3C validator. – Max Truxa Dec 22 '13 at 00:46
  • It's no problem of the validator. The document is declared as XHTML, and in XHTML the [content of script-element is defined as #PCDATA](http://www.w3.org/TR/xhtml1/#h-4.8) (parsed character data) . It's simply not valid, and the validator is doing what he has been intended for. – Dr.Molle Dec 22 '13 at 02:35