close

 

<html>
    <head >
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>           
<script src="js/jquery.js"></script>
<script>
var Submit = function ()
{
    var URLs = "Ajax.aspx";
    var Val = document.getElementById('val').value;

    $.ajax({
        url: URLs,
        data: ({Text : Val}),
        type: "GET",
        dataType: 'text',

        success: function (msg) {
            alert(msg);
        },

        error: function (xhr, ajaxOptions, thrownError) {
            alert(xhr.status + thrownError);
            alert();
        }
    });
}
</script>
</head>
    <body>
        <form id="sentToBack">   
            <input type="text" id="val" name="Text" />    
            <input id="Button16" type="button" value="Html Button AJAX" onclick="Submit()" />
        </form>
    </body>
</html>
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 芭樂養樂多 的頭像
    芭樂養樂多

    隨手筆記

    芭樂養樂多 發表在 痞客邦 留言(0) 人氣()