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>
全站熱搜