Server side:
....
$_SESSION['accountId'] = $accountId;
$_SESSION['type'] = $_POST['accountType'];
echo '1';
return;
Client side:
$.ajax(
{
type:'POST',
data: $("#flowFormSubmit").serialize(),
dataType:'text/plain',
timeout:1000,
success:function(response){
if(-1 == response)
alert('fail');
else
alert('succeed');
}
});
I've tested that it stops right at 'return;' Under what conditions will success function not be called?
EDIT:
after adding error callback,it's caught,but didn't output useful information yet:
error:function(response){ alert(response);alert(response.statusText); },
It outputs only:
[object XMLHttpRequest]
OK
Why does it fall in error callback?