snippet: view plain - save this
1 function deleteContactListActual() {
2 var fullAddresses = "";
3 var contactListFullAddress = getContactListID(curContactList);
4 var uniqueRef="";
5 var curContactListLoc = curContactList;
6
7 var paramDeleteContactList = 'deleteContactList='+'&userContactListID='+contactListFullAddress;
8
9 new Ajax.Request(contactListDeleteUrl, {
10
11 method : 'post',
12 onLoading: function() {
13 if (!$('splashCommonPage')) {
14 showSplashCommon();
15 }
16
17 },
18 onSuccess : function(xh) {
19
20 hideSplashCommon();
21 if (xh.responseText.toLowerCase().indexOf('error') == -1){
22
23 uniqueRefContactListGroup = curContactListLoc + '_group';
24 uniqueRefContactListGroupTop = curContactListLoc + '_groupTop';
25
26 uniqueRefContactListGroup = uniqueRefContactListGroup.replace(/\s/, '_');
27 uniqueRefContactListGroupTop = uniqueRefContactListGroupTop.replace(/\s/, '_');
28
29 // removal of all ul tags or all contactLists
30 if ($(uniqueRefContactListGroup)) {
31 $(uniqueRefContactListGroup).parentNode.removeChild($(uniqueRefContactListGroup));
32 }
33 if ($(uniqueRefContactListGroupTop)) {
34 $(uniqueRefContactListGroupTop).parentNode.removeChild($(uniqueRefContactListGroupTop));
35 }
36
37 deleteContactListID(contactListFullAddress);
38 }
39
40
41 },
42 onFailure : function(xh) {
43 alert("Oops, there's been an error.");
44 },
45 parameters : paramDeleteContactList
46
47 });
48
49 }

0 comments