I want to call a PHP function from Ajax request. This PHP function will take more than 2 to 3 Min. to execute And user may not want to wait for 2 min. So for this I am planing to make ajax call and redirect to another page so that User can take another request. Till I did -
new Ajax.Request(reloadurl, {
method: 'POST',
data: $('edit_form').serialize(),
parameters: $('edit_form').serialize(true)
onComplete: function(transport) {
//alert(transport.responseText);
window.location = backurl;
},
onCreate : function () {
alert('dsdsdsds');
window.location = backurl;
},
onFailure: function() {
alert('Something went wrong...');}
});
But Its not working.. Please help me out- Suggest me the way so that I can call another ajax request simultaneously