我對HTML和JQuery非常陌生,但是我已經寫了一個html文件並在eclipse中添加了一個jquery引用。這兩個文件(html和js)都在eclipse中的相同位置。當我運行HTML時,我期望在輸出中看不到jQuery功能,只顯示HTML輸出。這是爲什麼發生?有沒有其他方法可以看到我通過JQuery輸入的動畫,或者我的鏈接是一個問題?以下是我的HTML和JS文件。jquery未鏈接到html
的test.html:
<!DOCTYPE html>
<html>
<head>
<title>Behold!</title>
<link rel='stylesheet' type='text/css' href='http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css'/>
<script type='text/javascript' src='script.js'></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script>
</head>
<body>
<div id="menu">
<h3>jQuery</h3>
<div>
<p>jQuery is a JavaScript library that makes your websites look absolutely stunning.</p>
</div>
<h3>jQuery UI</h3>
<div>
<p>jQuery UI includes even more jQuery goodness!</p>
</div>
<h3>JavaScript</h3>
<div>
<p>JavaScript is a programming language used in web browsers, and it's what powers jQuery and jQuery UI. You can learn about JavaScript in the <a href="http://www.codecademy.com/tracks/javascript" target="blank" style="text-decoration:none; color:#F39814">JavaScript track</a> here on Codecademy.</a></p>
</div>
</div>
</body>
</html>
的script.js文件: - ============
$(document).ready(function() {
$("#menu").accordion({collapsible: true, active: false});
});
謝謝..
請注意,jQuery 2.0將無法在IE8或更高版本中工作。 – Spokey 2013-05-08 15:23:46