我寫了一些使用jQuery的東西,它在Chrome中效果很好。當我試圖在IE中打開它看起來像jQuery是不是在所有加載...現在我試圖儘可能簡單的jQuery的演示,它仍然無法正常工作......jQuery在IE中不工作8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script type="text/javascript" src="jquery-1.4.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("a").click(function(e){
(e.preventDefault();
$(this).hide("slow").show("fast");
});
});
</script>
</head>
<body>
<a href="http://jquery.com/">jQuery</a>
</body>
</html>
頁面應該隱藏,然後顯示鏈接,但它只是鏈接到jQuery網站,當我在IE中打開它。它在Chrome中正常工作....
那麼究竟發生了寫的?它是不是在隱瞞什麼? – 0x60 2011-01-20 09:15:47
從理論上講,它會做什麼,由於它的怪癖模式之中。當IE處於這種狀態它不允許你設置元素的屬性,因此,jQuery不能動畫 – Olical 2011-01-20 09:19:20
它沒有隱藏......它看起來好像根本就沒有jQuery ......鏈接正常工作....需要我到jQuery的網站... – rusbi 2011-01-20 09:25:43