利用JQuery框架ajax驗證

 HMTL代碼:

<html xmlns="http://www.w3.org/1999/xhtml " >
<head runat="server">
    <title></title>
    <script src="jquery-1.2.6.min.js" type="text/javascript"></script>
    <script>
        $(document).ready(function() {
        $("#Button1").click(function() {
                $.ajax({
                    type: "get",
                    url: "ResponsePage.aspx?t=0",
                    dataType: 'html',
                    success: function(data) {
                        alert("post " + data);
                    },
                    error: function() { alert('error!'); }
                });
            });
        });

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <input id="Button1" type="button" value="顯示" />
    </div>
    </form>
</body>
</html>

 

 

 

//ResponsePage.apsx

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章