I am using ajax call in my classic asp application to execute a stored procedure.
But I don’t want to wait until the stored procedure is running (Stored procedure taking approx 5-10 minutes to complete.).
The Ajax have to invoke the stored procedure and need to come back immediately.
I want Ajax call should not wait for response.
Here is my code snippet:
1) $.ajax({
type: "POST",
url: "runstoredprocedure.asp",
});
2) setInterval(function(){ jQuery("#list").trigger("reloadGrid"); },10000);
These are the two ajax calls I am using. the first one is running approxmately 5-7 min. Second one is not firing until first one completes. But immediately i need to call the second ajax call.
Can anyone help me on this issue.
AJAX is by default asynchronous ( and it’s the default option in all the javascript libraries ). For example, in jQuery:
You have a success, which takes a callback. When your action will finish, the callback will be called. jQuery will return immediately.