PDA

View Full Version : I cannot get this to validate


john obrien
09-13-2006, 02:39 AM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xtml1-strict.dtd">
<html>
<head>
<title>Hello World</title>
</head>
<body>
<script type="text/javascript">
type="text/javascript">
<!--HIDE FROM INCAPATIBLE BROWSERS
var worldVar = "World" ;
var sunVar = "Sun" ;
var moonVar = "Moon" ;
var worldInfo = 92897000 ;
var sunInfo = 72000000 ;
var moonInfo = 3456 ;
//STOP HIDING FROM INCOMPATIBLE BROWSERS-->
document.write("<p>Hello " + worldVar + "!<br />");
document.write("The " + worldVar + " is "
+ worlfInfo + " miles from the " + sunVar + ".<br />");
document.write("Hello + sunVar + !<br />");
document.write(The " + sunVar
+ "';s core temperature is approximately "
+ sunInfo + " degrees Fahrenheit" + " .<br />");
document.write("The " + moonVar + " is " + moonInfo
+ " miles in diameter.</p>");

</script>
</body>
</html>

hurloon
09-13-2006, 04:41 AM
perhaps because of this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xtml1-strict.dtd">
<html>
<head>
<title>Hello World</title>
</head>
<body>
<script type="text/javascript">
type="text/javascript">
<!--HIDE FROM INCAPATIBLE BROWSERS
var worldVar = "World" ;
var sunVar = "Sun" ;
var moonVar = "Moon" ;
var worldInfo = 92897000 ;
var sunInfo = 72000000 ;
var moonInfo = 3456 ;
//STOP HIDING FROM INCOMPATIBLE BROWSERS-->
document.write("<p>Hello " + worldVar + "!<br />");
document.write("The " + worldVar + " is "
+ worlfInfo + " miles from the " + sunVar + ".<br />");
document.write("Hello + sunVar + !<br />");
document.write(The " + sunVar
+ "';s core temperature is approximately "
+ sunInfo + " degrees Fahrenheit" + " .<br />");
document.write("The " + moonVar + " is " + moonInfo
+ " miles in diameter.</p>");

</script>
</body>
</html>

_Aerospace_Eng_
09-13-2006, 04:50 AM
Not only that but moving your script to an external js file will also solve your problem. You could also use the correct CDATA comments but I think moving your script to the external file is more efficient.