<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'firstJquery.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script type="text/javascript" src="../js/jquery-2.0.3.js"></script>
<script type="text/javascript">
jQuery(document).ready(function(){debugger;
jQuery("p").click(function(){
jQuery(this).hide();
});
});
</script>
</head>
<body>
<p>if you click me,i will disappear</p>
</body>
</html>
------解决方案--------------------
什么问题?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'firstJquery.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("p").click(function(){
jQuery(this).hide();
});
});
</script>
</head>
<body>
<p>if you click me,i will disappear</p>
</body>
</html>
去掉debugger
------解决方案--------------------
你好歹描述一下需求啊
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function(){//debugger;
jQuery("p").click(function(){
jQuery(this).hide();
});
});
</script>
------解决方案--------------------
debugger;这个好像是 ..net 里可以的。
------解决方案--------------------
说你没有定义的原因就是你的库没引入,所以你的相对路径或者JQ库的文件名肯定是由问题的。
不要说肯定没问题,请仔细检查