我有以下的html。它通過了W3驗證器,但我的JavaScript警告不起作用。任何人都可以看到任何問題或有任何建議如何讓它的工作?爲什麼我的javascript不起作用
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Company Name™</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<style type="text/css">
BODY {
background-image: url(images/bg4.jpg);
background-repeat:no-repeat;
background-position:center top;
background-attachment: fixed;
}
</style>
<script type="text/javascript">
alert("HELLO");
</script>
</head>
<body>
<div id="wrapper">
<div id="header">
<div class="logo">
<img src="images/fcflogo.png" width="295" height="100" align="left" alt="logo"/>
</div>
<div class="header1">
<a href="financialprotection.html">100% Financial Protection</a>
<hr/>
</div>
<div class="nav">Home| Flights| Hotels| Villas | CarHire| Attractions| Contact</div>
</div>
<div class="ver1">
<h2>Can't find what your looking for?</h2>
</div>
<div class="enq1">
<h2>Enquiry Form</h2>
</div>
<div class="hor1">
<h2>Our Service</h2>
<a>Company Name are one of the leading independent travel companies specialising in Florida Holidays. We have a wide range of major Charter and Scheduled airlines to choose from as well as over 10,000 Hotel and Villa deals. Our aim is to provide you the customer with a truly fantastic vacation in Florida from start to finish at affordable prices. We are not committed to any airline or Tour operator so are totally committed to finding you the best deal.</a>
</div>
<div class="hor1"><a>FLIGHTS</a></div>
<div class="ver2"><a>HOTELS</a></div>
<div class="ver2"><a>VILLAS</a></div>
<div class="hor1"><a>CAR HIRE</a></div>
<div class="hor1"><a>ATTRACTIONS</a></div>
</div>
<hr/>
<div id="footer"><a>FOOTER</a></div>
</body>
</html>
編輯 - 下面的所有,我必須啓用JavaScript,我使用Debian與Firefox,NoScript的是殘疾人,但警報並未出現,即使我將它移動到身體。
它適用於Windows 7和Google Chrome 7的操作系統。您使用的瀏覽器,瀏覽器版本和操作系統是什麼?您是否在不同的瀏覽器上測試了這個版本? – 2010-09-19 13:46:23
如果您正在討論警報「HELLO」),這工作得很好,你期望它做什麼,它不是在做什麼? – Robusto 2010-09-19 13:48:23
警報不會出現在我身上。我正在使用Linux(debian)和firefox。我也在chrome中測試過,它不工作。 – 2010-09-19 13:57:29