Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function _AJAXRequestStates(request, whenOk, whenFailed, atEnd) {
- if (request.readyState === 4) {
- if (request.status === 200) {
- if (whenOk !== undefined && whenOk !== null) {
- if (!checkIsAFunction(whenOk)) {
- throw new Error("The parameter whenOk must be a function")
- }
- whenOk(request.responseText);
- }
- }
- else {
- if (whenFailed !== undefined && whenFailed !== null) {
- if (!checkIsAFunction(whenFailed)) {
- throw new Error("The parameter whenFailed must be a function")
- }
- whenFailed(request.responseText);
- }
- }
- if (atEnd !== undefined && atEnd !== null) atEnd(request.responseText);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement