I am trying to get the status of a 403 forbidden error, i can do it with php curl but need to do it using jquery.
Here is my code.
$.ajax({
url: 'https://s3.amazonaws.com/isdukg/01-jaimeson-complete_2_step_mix-pulse.mp3',
type: 'GET',
crossDomain: true,
dataType: 'jsonp',
statusCode: {
403: function() {
alert("Forbidden");
// or do something useful
}
}
});
$.ajax({
url: 'https://s3-eu-west-1.amazonaws.com/fkcreate/Angles%2C%20Circles%20and%20Triangles..%20Instrumental.mp3',
type: 'GET',
crossDomain: true,
dataType: 'jsonp',
statusCode: {
403: function() {
alert("Forbidden");
// or do something useful
}
}
});
One of the urls will produce a 403 forbidden error which you can see here if you open the console window and load the page - http://scaredem.users36.interdns.co.uk/
I cant seem to grab that error to do something useful with it.