Click here to Skip to main content
15,914,416 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have ajax inside ajax but its not working.....it does not going to debugger..
why...

What I have tried:

 $.ajax({
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    url: "WebService1.asmx/GetConsoleName",
                    async: false,
                    dataType: "json",
                    success: function (response) {
                        console = response.d.data;
                        $("#hdn").val(console);

                        debugger;
                        var data = null;
                        $.ajax({
                            type: "POST",
                            contentType: "application/json; charset=utf-8",
                            url: "WebService1.asmx/GetPlantMapName",
                            dataType: "json",
                            success: function (response) {
                                tmp = response.d.data;
                                debugger;
}
});
}
});
Posted
Comments
Karthik_Mahalingam 20-Apr-17 5:54am    
dont call twice, just consolidate the data and return in one shot.
Member 12893295 20-Apr-17 6:27am    
i have tried like this but it didn't get
function GetPlantName() {

var dataservice = new function () {
ConsoleName = function (callback) {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "WebService1.asmx/GetConsoleName",
async: false,
dataType: "json",
success: function (response) {
callback(response.d.data);
}
});
};
return {
ConsoleName: ConsoleName
};

} ();
var tmp2 = null;
dataservice.ConsoleName(function (data) {
tmp2 = data;
alert(tmp2);
});
}
Member 12893295 23-Apr-17 8:48am    
thanks its working for me...
Member 12893295 23-Apr-17 8:47am    
Thanks its working for me...
Karthik_Mahalingam 23-Apr-17 9:18am    
Cool

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900