How to fix Jquery error message: “character & is the first character of a delimiter but occurred as data javascript” if you work with javascript in XHTML document in W3C.
I have added a javascript in my comment input codes yesterday, and i have checked in W3C today it shows many errors.
It is my habit to try validating my sites, because i want all of browsers user can view my site properly.
When i check my codes, my error comes from my javascripts or jquery that i embeded before </head> sections.
First it shows me that in head sections, i can’t have span or div tag.
So i delete the span, div and any other attributes, the result was not different -failed on validating.
If you have XHTML documents, your document can’t handle Javascript, so you have to add some codes in your code.
The code will look like this:
<script type="text/javascript">
//<![CDATA[
your jquery or javascript function codes goes here.
//]]>
</script>
Save your documents and you will be successfully validating your site :D

