任何人都可以告訴我爲什麼'function()'之後需要使用.ready來使腳本工作嗎?jquery裏面的函數.ready
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
$("p").hide();
});
});
</script>
</head>
<body>
<h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<button type="button">Click me</button>
</body>
</html>
非常有幫助。我知道了。 – Philip007 2010-06-05 19:37:40