javascriptは初めてですが、C ++ C#VBを実行しました。しかし、このjavascriptの本は理解するのが難しいです、それは見るべき完全なコードを行使するだけです。とにかく私は簡単なプロジェクトをやっていますが、どこが間違っているのかわかりません。CDATAは、私が間違っていると私が信じているところです。これは私の2番目のプロジェクトであり、最初のプロジェクトは簡単でした。CDATAとVarがスタックするまではありませんでした。私はこのコードが古くなっていることを知っていますが、私はこの本に従って基本的なJSを学び、上に向かって進んでいます。コードは次のとおりです。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Largest Islands</title>
<meta http-equiv="content-type" content="text/html; charset=iso-
8859-1" />
</head>
<body>
<h1>Largest Islands</h1>
<script type="text/javascript">
/* <![CDATA[ */
var island1Name = "Greenland";
var island2Name = "New Guinea";
var island3Name = "Borneo";
var island4Name = "Madagascar";
var island5Name = "Baffin";
var island1Size = 2175600;
var island2Size = 790000;
var island3Size = 737000;
var island4Size = 587000;
var island5Size = 507000;
document.write("<p>The largest island
in the world is " + island1Name
+ " with " + island1Size + " miles.</p>");
document.write("<p>The second largest island
in the world is " + island2Name
+ " with " + island2Size + " miles.</p>");
document.write("<p>The third largest island
in the world is " + island3Name
+ " with " + island3Size + " miles.</p>");
document.write("<p>The fourth largest island
in the world is " + island4Name
+ " with " + island4Size + " miles.</p>");
document.write("<p>The fifth largest island
in the world is " + island5Name
+ " with " + island5Size + " miles.</p>");
/* ]]> */
</script>
</body>
</html>
それは非常に単純なプロジェクトであり、どこが間違っているのかを理解するのに助けが必要です。前もって感謝します