1、普通ajax请求:
para = {}; para.action = "getUserInfo";//post请求的参数用Request.Params["action"];接收 para.timespan = new Date().getTime(); para.id = val; $.ajax({ url: "ashx/bg_user.ashx",data: para,type: "POST",dataType: "json",success: function (data) { //data为json对象集合,所以此处用[0] return data[0].UserName; } });