<%@ 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>
<%
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>
解决方案 »
- 求救!!用js实现html页面截图
- 请教:javascript实例引用问题
- jsp动态合并行,现在遇到一个很困难的问题,希望有高手帮忙解决下!谢谢!
- javascript做聊天
- 求助:document.getElementById(...).className = ''不执行!
- 为什么我的display:none没有起作用?
- 急急急!!!怎么可以让两边的广告flash或者浮标窗口等在主页显示出来之后再弹出来???
- 请教一个js和Applet的问题!
- 为什么显示undefined,------alert(Calendar.Month);
- 怎么固定<ul>标签中的第一列,滚动条只改变其他列。
- extjs这个页面如何设计,求大神
- 如何替换输入内容
<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>
你这种我试了是可以的,我现在自己下载到本地的jquery类库,我这样引入就不行<script type="text/javascript" src="../js/jquery-2.0.3.js"></script>,路径没有任何问题。
你这种我试了是可以的,我现在自己下载到本地的jquery类库,我这样引入就不行<script type="text/javascript" src="../js/jquery-2.0.3.js"></script>,路径没有任何问题。
说你没有定义的原因就是你的库没引入,所以你的相对路径或者JQ库的文件名肯定是由问题的。
不要说肯定没问题,请仔细检查
你这种我试了是可以的,我现在自己下载到本地的jquery类库,我这样引入就不行<script type="text/javascript" src="../js/jquery-2.0.3.js"></script>,路径没有任何问题。
说你没有定义的原因就是你的库没引入,所以你的相对路径或者JQ库的文件名肯定是由问题的。
不要说肯定没问题,请仔细检查找到问题了,是这个<base href="<%=basePath%>">问题导致引用出问题了