Apr 28, 2015, 5:28 PM
[Closed] jquery ajax not working asynchronously
I have a problem my ajax methods do not work asynchronously. Can someone help me out ?.
The method a () returns a single record, while the method b () returns 500 records.
I want the function a () is executed if the function b () is not finished running, I want to work asynchronously with ExtNet.
I need some way to make asynchronous requests to the server.
The method a () returns a single record, while the method b () returns 500 records.
I want the function a () is executed if the function b () is not finished running, I want to work asynchronously with ExtNet.
I need some way to make asynchronous requests to the server.
<script>
function a() {
var param = "Some value";
$.ajax
({
url: "WebForm1.aspx/getDetail",
data: "{eUnidad:'" + param + "'}",
type: "POST",
async: true,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (respuesta) {
alert('teminado');
},
error: function (xhr, status) {
alert('Disculpe, existió un problema');
}
});
}
function b() {
var param = "someValue";
$.ajax
({
url: "WebForm1.aspx/getAllDetails",
data: "{jsons:'" + param + "'}",
type: "POST",
async: true,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (respuesta) {
alert('teminado');
},
error: function (xhr, status) {
alert('Disculpe, existió un problema');
}
});
</script>
Last edited by krizalid0; May 04, 2015 at 2:19 PM.