62,053
社区成员
发帖
与我相关
我的任务
分享
$(document).ready(function() {
$('#btn1').click(function() {
$.ajax({
type: "POST",
contentType: "application/json",
url: "IsExist.asmx/IsExistEmail", //返回string类型 1为存在 0为不存在
data: "{value:'d@d.c'}",
dataType: 'json',
success: function(result) {
alert(result);//显示 0
alert(result.d);//显示 undifined
},
error: function(d) { alert("err:" + d); alert("err:" + d.d); }
});
});
});
$(document).ready(function() {
$('#btn1').click(function() {
$.ajax({
type: "POST",
contentType: "application/json",
url: "webservice.asmx/helloworld",//返回string :"helloworld"
data: "{}",
dataType: 'json',
success: function(result) {
alert(result);//显示 [Object object]
alert(result.d);//显示 helloworld
},
error: function(d) { alert(d); alert(d.d); }
});
});
});