I'm validating my pages through http://validator.w3.org/ and only 4 errors were found, but in the same statement. and is to do with the div classes inside the brackets. Can anyone please help?
Thank you so much.
<script language="javascript" type="text/javascript" >
$(function(){
$("#ContactForm").submit(function(){
$("#submitf").value='Please wait...';
$.post("process.php?send=comments", $("#ContactForm").serialize(),
function(data){
if(data.frm_check == 'error'){
$("#message_post").html("<div class='errorMessage'>ERROR: " + data.msg + "!</div>");
document.ContactForm.submitf.value='Resend >>';
document.ContactForm.submitf.disabled=false;
} else {
$("#message_post").html("<div class='successMessage'>Thank you. We'll be in touch shortly.</div>");
$("#submitf").value='Send >>';
}
}, "json");
return false;
});
});
</script>
The XHTML 1.0 Recommendation itself says, in Compatibility Guidelines, item C 4: “Use external scripts if your script uses < or & or ]]> or --.” The reason is that by XHTML rules, script
element content is parsed by normal rules, so those characters are or they may be markup-significant.
Using <
for <
etc. would fix this as regards to processing XHTML by the book, including general XML processing. But you probably intend to throw your page at various web browsers, and they will generally not do such processing but will handle the page as if it were HTML, and then things would fail.