日期:2014-05-16  浏览次数:20287 次

菜鸟学习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