Skip to content

Instantly share code, notes, and snippets.

@balkhaev
Last active August 23, 2016 10:15
Show Gist options
  • Save balkhaev/ec0994657e4b3246a4fe3b15b6136ef1 to your computer and use it in GitHub Desktop.
Save balkhaev/ec0994657e4b3246a4fe3b15b6136ef1 to your computer and use it in GitHub Desktop.
switch (Math.floor(HTTPStatus / 100)) {
case 1:
// Informational 1xx
console.log("Information code " + vMsg);
break;
case 2:
// Successful 2xx
console.log("Successful code " + vMsg);
break;
case 3:
// Redirection 3xx
console.log("Redirection code " + vMsg);
break;
case 4:
/* Client Error 4xx */
alert("Client Error #" + vMsg);
break;
case 5:
/* Server Error 5xx */
alert("Server Error #" + vMsg);
break;
default:
/* Unknown status */
ajaxError();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment