Add an error callback to your $.ajaxdebug call if the request does not work.
$.ajax({
type: "POST",
url: "test.php",
data: postData,
success: function(){
alert(proj_name + ' ' + status);
window.open("test.php");
},
error: function (xhr, ajaxOptions, thrownError){
alert(xhr.status);
alert(thrownError);
}
});
<h / "> Update
Change this:
if ($_POST)){
echo $proj_name;
echo $date;
echo $req_comp_date;
echo $status;
echo $secondUserId;
} else {
echo 'problem';
}
For this:
if ($_POST)){
$vals = array(
'proj_name' => $proj_name,
'date' => $date,
'req_comp_date' => $req_comp_date,
'status' => $status,
'secondUserId' => $secondUserid
);
echo json_encode($vals);
exit;
} else {
echo json_encode(array('errror' => TRUE, 'message' => 'a problem occured'));
exit;
}
Now in your jQuery callback .success:
success: function(data){
alert(data.req_comp_date);
alert(data.proj_name + ' ' + data.status);
window.open("test.php");
if(data.error)
alert('ERROR: ' + data.message);
},
(jquery ), , , .
$.ajax({ ...
type: "POST",
url: "test.php",
data: postData,
dataType: "json"
.... });