以及即時通訊新的JavaScript我已經完成了C++ C#VB。但是這個javascript書很難理解,它只是練習沒有完整的代碼來看待。無論如何,我正在做一個簡單的項目,但我不明白我要去哪裏錯了。 CDATA是我認爲我錯了的地方。這是我的第二個項目,第一個很容易,直到CDATA和Var得到Stuck。我知道這段代碼已經過時了,但是我正在學習這本書來學習基本的JS,並且繼續努力。繼承人的代碼:我有問題與CDATA在javascript中
<!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>
它是一個非常簡單的項目我只需要一些幫助,找出我出錯的地方。預先感謝您
不,CDATA不是你要出錯的地方。它應該做什麼?它不正確的做法是什麼?你有錯誤嗎? – ceejayoz 2013-02-13 17:38:52
那麼有什麼不行? – Bergi 2013-02-13 17:39:33