On user event async ajax call not working asynchronously. Issue may be due session. found one solution session_write_close
But how to integrate this with codeingiter. jquery ajax call not asynchronous
button1 click action1() 30seconds
button2 click action2() 5seconds
If I click on button1 first then button2 . I want action2() should not wait to finish execution of action1().
Below is sample code
function action1(){
$.ajax({
url: '/action1',
type: 'POST',
dataType: "json",
async: true,
data: $( 'form[name=form1]' ).serialize(),
success : function(result) {
console.log(result);
},
});
}
function action2(){
$.ajax({
url: '/action2',
type: 'POST',
dataType: "json",
async: true,
data: $( 'form[name=form2]' ).serialize(),
success : function(result) {
console.log(result);
},
});
}
1 Answer 1
It works async as expected. You can check it in chrome or firefox console in network tab. The reason of slow response can be on the server side of your app.
1 Comment
Explore related questions
See similar questions with these tags.
beforesendevent, I'm sure you will see it fire.