-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAJAXer - Применение.js
49 lines (36 loc) · 1.17 KB
/
AJAXer - Применение.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//
// /* Îòêëþ÷åíèå àÿêñà
var result = AJAX('POST', ReqTypeIsAsyncBool , serverUrl , FINAL );
console.log(result);
// #### #### #### ####
// #### Ðàçáîð ðåçóëüòàòîâ
if( result['STATUS_SUCCESS'] === true )
{
console.log('%cÓñïåøíàÿ îòïðàâêà => ' + result['ANSWER'], 'color:black; background-color:lime; font-size:16px');
}
else
{
console.log('*** Îøèáêà ***');
console.log('Òèï çàïðîñà: '+ReqType);
if( ReqType === 'ASYNC' )
{
console.log('%cÏëàíîâûé âûëåò: Òê ASYNC - íå äîæèäàëèñü îòâåòà, îí ïðèäåò ïîçæå.','color:black; background-color:#d1ff00;');
console.log('!!! Ïðîâåðÿòü, òê àñèíõ òîæå ìîæåò âûëåòåòü, íàïð ïî 500');
}
else
{
console.log('%c### Ýòî âíåïàëíîâûé âûëåò ###', 'color:black; background-color:red; font-size:16px');
console.log('ERROR_MSG: '+result['ERROR_MSG'] );
console.log('ERROR_MSG_REAL: '+result['ERROR_MSG_REAL'] );
console.log('ERROR_RESP_CODE: ' + result['ERROR_RESP_CODE'] );
if( importantLog )
{
// Òóò ìîæíî âñòàâèòü òàéìåð. 300ìñ
console.log('Ýòî âàæíûé ëîã, íî âûëåòåë. Îòïðàâëÿþ ïîâòîðíî 1 ðàç.');
var result = AJAX('POST', ReqTypeIsAsyncBool , serverUrl , FINAL );
console.log(result);
}
}
}
// */
// End