<span style="font-family:SimHei;font-size:14px;">function dataForJson(url,dataJson) { var json; $.ajax({ type: "POST",url: url,获取数据的链接(指向的是WebService.asmx,例如:../webservice/ajaxDecisionService.asmx/selectOperationCount) data: dataJson,contentType: "application/json; charset=utf-8",dataType: "json",async: false,//如果要在$.ajax外面获取ajax获取到的值,则ajax必须获得同步 success: function (msg) { json = msg; } }); return json; }</span>