Reputation: 4360
$.ajax({
type: "POST",
url: "check-email",
data: {email: "[email protected]"},
success: function(data)
{
// success part here
},
error: function(xhr)
{
alert(xhr.status);
}
});
This will call another PHP file. But the sad thing is the error
part is executed always with xhr.status
printing as 0. What would be the problem?
Note:
1. This works perfectly in the local.
2. Both the script, check-email page is located in the same server.
3. The server is secured with https and it is in WWW version.
Update:
error: function(jqXHR, textStatus, errorThrown)
{
alert(textStatus, errorThrown);
}
This prints simply as "error".
Upvotes: 0
Views: 167
Reputation: 20747
I would have done this as a comment but the code would be a nightmare.
In your PHP page write this somewhere:
<?php
echo '<pre>'.print_r($_POST, true).'</pre>';
echo '<pre>'.print_r($_GET, true).'</pre>';
?>
Now:
Upvotes: 1