snippet: view plain - save this
1 function blockContact(fulladd) {
2
3 if (connectionObj.forcedLogout) {
4 isDisconnectedForcedLogout();
5 return false;
6 }
7
8 var selFullAddress = fulladd;
9 var paramBlockContact= 'blockContact='+'&contactID='+selFullAddress;
10
11 new Ajax.Request(contactBlockUrl, {
12
13 method : 'post',
14 onComplete : function(xh) {
15 var output = JSON.parse(xh.responseText);
16
17 if (!connectionObj.forcedLogout) {
18 if (isDisconnectedForcedLogout(output)) {
19 return false;
20 }
21 } else {
22 isDisconnectedForcedLogout(output);
23 return false;
24 }
25
26 if (xh.responseText.toLowerCase().indexOf('error') == -1){
27 blockContactActual(selFullAddress);
28 }
29
30 },
31 onFailure : function(xh) {
32 alert("Oops, there's been an error.");
33 },
34 parameters : paramBlockContact
35
36 });
37
38 }

0 comments