It is worth noting
When the input is a Json type, var user = eval(result.d);
When the input is a string, use eval("exception = " result.responseText);
Copy code The code is as follows: > type: "POST",
contentType: "application/json",
url: serviceURL "/UserLogin",
data: "{UserLoginID:'" $('#txtLoginID').val( ) "',UserLoginPW:'" $('#txtLoginPW').val() "'}",
dataType: 'json',
success: function(result)
{
var user = eval(result.d);
//eval("user=" result.d);
location.href = "Welcome.aspx?userID=" user.UserID
},
error: function(result, status)
if(status == 'timeout')
alert("The request timed out, please resubmit");
}
else
{
eval("exception = " result.responseText); 🎜> }
}
}
);