添加JQuery库的方式:
1.从http://docs.jquery.com/Downloading_jQuery#Download_jQuery下载JQuery库,然后将下载下来的js文件放到你的jsp文件目录下(这里下载下来的js文件必须和jsp文件下的src中的名字一样,如下)。
在jsp中加入<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
//jquery code
</script>
2.使用外部链接:
使用 Google 的 CDN
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>
</head>
使用 Microsoft 的 CDN
<head>
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.min.js"></script>
</head>