I am trying to test the error callback using the below scenarios :
- Change my url : "telemetry.php" to url : "asdasfjgafas.php"
- Have
<?php header("HTTP/1.1 404 Not Found"); exit() >inside telemetry.php
But, I don't get alert() of the error callback even after trying 1. and 2. separately!
My .js content making AJAX request using jQuery :
$.ajax({
url : "telemetry.php",
data : ({
DshBrdName : strFullDashBoardName,
DshBrdID : currentDashboard,
r : Math.random()
}),
success : function(data, textStatus, jQxhr){
alert(textStatus);
},
error : function(jqXHR, textStatus, errorThrown){
alert(textStatus);
alert(errorThrown);
},
type : "POST"
});
P.S : I am able to get success alert when I have valid url and valid php code!