<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'index.jsp' starting page</title>
<script language="javascript" type="test/javascript" src="jquery.js"></script>
<script type="text/javascript">
var jq = jQuery.noConflict();
jq(function(){
jq("#test").click(function(){
alert("成功!!");
})
})
</script>
</head>
<body>
<input id="test" type="button" value="Display alert box" />
</body>
</html>
就这么短的程序,jquery不工作。这里的页面和jquery在同一个目录下。大家帮帮忙看看吧
------解决方案--------------------
type="test/javascript"
test ---> text
就可以了