function changePassword() {
if (isInputEmpty()) {
$.ajax({
type: 'POST',
data: '...'
url: '...',
success: function (result) {
if (result.substring(0, 3) != "!!!") {
//success
} else {
//faliure
}
},
error: function () {
}
});
}
}
And of course,in production, it always reported success and never changed the password, because of equally bad server code.