2017年11月22日 星期三

[研究][C#][ASP.NET] jQuery 3.2.1 官方下載、安裝、試用

[研究][C#][ASP.NET] jQuery 3.2.1 官方下載、安裝

2017-11-22

jQuery 官方網站
http://jquery.com/

jQuery 用法請看 jQuery API Documentation,這裡不討論
http://api.jquery.com/

範例
http://learn.jquery.com/about-jquery/how-jquery-works/

測試工具:Visual Studio 2017 v15.4.4



(一) 直接使用遠端的 jQuery ( 電腦必須連上 Internet )


<%@ page language="C#" autoeventwireup="true" codebehind="Default.aspx.cs" inherits="WebApplication1.Default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
        </div>
    </form>

    <%--http://learn.jquery.com/about-jquery/how-jquery-works/--%>
    <a href="http://jquery.com/">jQuery</a>
    <script>
     $( document ).ready(function() {
        $( "a" ).click(function( event ) {
            alert( "The link will no longer take you to jquery.com" );
            event.preventDefault();
        });
    });
     </script>
</body>
</html>



(下圖) 點選 jQuery 超連結後,會跳出訊息視窗


(二) 下載使用 jQuery

把下載得到的 jquery-3.2.1.min.js 放在你想放的資料夾中,在網頁中引用,即可使用 jQuery。









<%@ page language="C#" autoeventwireup="true" codebehind="Default.aspx.cs" inherits="WebApplication1.Default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
        </div>
    </form>

    <%--http://learn.jquery.com/about-jquery/how-jquery-works/--%>
    <a href="http://jquery.com/">jQuery</a>
    <script>
     $( document ).ready(function() {
        $( "a" ).click(function( event ) {
            alert( "The link will no longer take you to jquery.com" );
            event.preventDefault();
        });
    });
     </script>
</body>
</html>



(完)

相關

[研究][C#][ASP.NET] jQuery 3.2.1 官方下載、安裝、試用
http://shaurong.blogspot.com/2017/11/caspnet-jquery-321.html

[研究][CSS] iCheck v1.0.2 (在不同流覽器和設備上都有相同的表現) 安裝與試用 (NuGet安裝)
http://shaurong.blogspot.com/2017/11/css-icheck-v102-nuget.html

[研究] [ASP.NET] hideShowPassword 元件安裝、試用
http://shaurong.blogspot.com/2017/11/aspnet-hideshowpassword.html

[研究] jQuery UI Datepicker 月曆 安裝與試用
http://shaurong.blogspot.com/2017/07/jquery-ui-datepicker.html

[研究] [C#] [ASP.NET] 用 SweetAlert + Button 作 送出確認 提示對話盒
http://shaurong.blogspot.com/2017/06/c-aspnet-sweetalert_23.html

[研究] [C#] [ASP.NET] 用 SweetAlert + LinkButton 作 刪除確認 提示對話盒
http://shaurong.blogspot.com/2017/06/c-aspnet-sweetalert.html

[研究][C#][ASP.NET] Bootstrap 3.3.7 安裝(NuGet)
http://shaurong.blogspot.com/2017/01/caspnet-bootstrap-337-nuget.html

[研究][C#][ASP.NET] jQuery 3.1.1 安裝(NuGet)
http://shaurong.blogspot.com/2017/01/caspnet-jquery-311-nuget.html

[研究][C#][ASP.NET] jQuery Cookie 1.4.1 - jQuery Plugin 安裝(NuGet)
http://shaurong.blogspot.com/2017/01/caspnet-jquery-cookie-141-jquery-plugin.html

[研究] [C#][ASP.NET] Select2 v4.0.3 - jQuery Plugin 安裝
http://shaurong.blogspot.com/2017/01/caspnet-select2-v403-jquery-plugin.html

[研究] Visual Studio 2015 用 Nuget 安裝 jQuery
http://shaurong.blogspot.com/2016/11/visual-studio-2015-nuget-jquery_14.html

沒有留言:

張貼留言