View Full Version : Resolved w3c Validation
marain
03-22-2015, 06:50 PM
Hello Folks (Did you miss me? A question perhaps better left unanswered.)
My question du jour: Is there a way to escape (or otherwise deal with) the logical and (&&) operator in order to not generate an error message when I do a w3c check on the page?
Best to all,
A.
molendijk
03-22-2015, 07:14 PM
Bonjour Marain,
Tu me manquais énormément.
Do you mean & or &&? I've never had validation problems with &&.
marain
03-22-2015, 07:28 PM
No, I do mean &&. Il ne marche pas!
A.
molendijk
03-22-2015, 07:45 PM
The validator does not complain about:
<!doctype html>
<html >
<head>
<title>Logical And</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script>
function bla()
{
if(2>1 && 3>2)
{
alert('3 bigger than 1')
}
}
</script>
</head>
<body>
<script>
bla()
</script>
</body>
</html>
marain
03-22-2015, 08:06 PM
Perhaps. But try to validate http://www.njdriverslicenses.com/quest.php and see what happens.
A.
Beverleyh
03-22-2015, 08:20 PM
Try encasing the script in CDATA tags
<script>
//<![CDATA[
... Script here ...
//]]>
</script>
marain
03-22-2015, 08:36 PM
Wow! It works! Thank you!
A.
molendijk
03-22-2015, 08:52 PM
Try encasing the script in CDATA tags
<script>
//<=!=[=C=D=A=T=A=[
... Script here ...
//]=]=>
</script>
Yes, or make sure your document is not parsed bythe XML parser. This can be done by choosing another doctype.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.