读书人

初学者学习jquery求帮助

发布时间: 2013-11-01 14:43:02 作者: rapoo

菜鸟学习jquery,求帮助
<%@ 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 里可以的。
[解决办法]
引用:
Quote: 引用:

你好歹描述一下需求啊


<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>,路径没有任何问题。


说你没有定义的原因就是你的库没引入,所以你的相对路径或者JQ库的文件名肯定是由问题的。
不要说肯定没问题,请仔细检查

读书人网 >JavaScript

热点推荐