UPdated JavaScript Ajax error handling.