Var tmp=null; function Fn() { var PlantName = function () { var dataPlantName = $.Deferred(); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "WebService1.asmx/GetPlantMapName", dataType: "json" }).done(function (response) { //console.log(response.d); dataPlantName.resolve(response.d.data); tmp = response.d.data; }); return dataPlantName.promise(); } (); alert(tmp); };
async:false
$.ajax({ type: "POST", url: "WebService1.asmx/GetPlantMapName", contentType: "application/json; charset=utf-8", dataType: "json", async: true, success: function (result) { } });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)