代码之家  ›  专栏  ›  技术社区  ›  Vibin Jith

我的jquery不工作

  •  -1
  • Vibin Jith  · 技术社区  · 15 年前
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Untitled Page</title>
    
       <script language="javascript" type="text/javascript">
        $(document).ready(function()
      {
        $(".button1").click(function ()
        {
          $("p").hide("slow");
        });
        $(".button2").click(function ()
        {
          $("p").show("slow");
        });
      });
        </script>  
         </head>
    <body>
        <form id="form1" runat="server">
    
    
        <input id="Button1" type="button" value="button" class="button1"/>
        <input id="Button2" type="button" value="button" class="button2"/><h2>Welcome to F5 Technologies </h2>
      <p>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp F5 Technologies is a rapidly developing company, acquiring its position on the business market,
      Our company helps make products 
         delivery more effective, efficient, and meaningful to our customers, and allow them to take greater 
         responsibility for their own new products.Software is developed by  the most experienced development staffs.   </p>
    
    
        </form>
    </body>
    </html>
    
    3 回复  |  直到 15 年前
        1
  •  1
  •   D.C.    15 年前

    您需要包括jquery库。

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
    
        2
  •  1
  •   Christian C. Salvadó    15 年前

    您没有包括jquery库本身:

    <script src="jquery.min.js" type="text/javascript">
    </script>
    

    您也可以从 CDN :

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"
      type="text/javascript"></script>
    
        3
  •  0
  •   Eilon    15 年前

    尽管我对这个问题发表了评论,但看起来主要的罪魁祸首是您实际上没有引用jquery js文件。尝试以下方法:

    <script type="text/javascript" src="Scripts/jquery-1.3.2.js"></script>
    
    推荐文章