前臺頁面ajax非同步呼叫後臺方法
阿新 • • 發佈:2018-12-31
$.ajax({
//要用post方式
type: "post",
//方法所在頁面和方法名
url: "login.aspx/Loginon",
contentType: "application/json",
dataType: "json",
data: "{ uname:'" + $("#txtsaname").val() + "',upwd:'" + $("#txtsapwd").val() + "',code:'" + $("#txtcode").val() + "',check:'" + document.getElementById("checkjz").checked + "'}",
success: function (result) {
var obj = result.d;
if (obj == 1) {
layer. msg
//要用post方式
type: "post",
//方法所在頁面和方法名
url: "login.aspx/Loginon",
contentType: "application/json",
dataType: "json",
data: "{ uname:'" + $("#txtsaname").val() + "',upwd:'" + $("#txtsapwd").val() + "',code:'" + $("#txtcode").val() + "',check:'" + document.getElementById("checkjz").checked + "'}",
success: function (result) {
var obj = result.d;
if (obj == 1) {
layer.