when jquery.ajax() call wcf,if success,how to use wcf return value?



$txtZip.bind('change',function(){ 

   $.ajax({type:"POST",

    url: "http://www.demo.url",      

     data:'{"postalCode":"' + $txtZip.val() + '"}',         

     contentType:"application/json; charset=utf-8",

     dataType:"json",

 

      success:function(ret) {alert(ret[0].Place);},

     error:function (xhr){alert("error");}

  });

});

the return value ,success:function(ret),

'ret' is the wcf method return value

原文地址:https://www.cnblogs.com/tuolin/p/1887422.html