function subMe (LocID, Username, UserID) { //alert ("Loeschen"); $("#sub"+LocID).hide(); $("#ajax-loader"+LocID).show(); var returnVal = -1; $.ajax({ type: 'POST', url: 'del.php', data: { UserID: UserID, LocID: LocID }, beforeSend:function(){ // this is where we append a loading image //$('#ajax-panel').html('
Loading...
'); }, success:function(returnVal){ // successful request; do something with the data $("#ajax-loader"+LocID).hide(); $('#ajax-panel').empty(); if (returnVal != 1) { $('#ajax-panel').append("DB update failed! returnVal: " + returnVal); } else { $("#img_" + LocID + "_" + Username).remove(); $("#add"+LocID).show(); } }, error:function(){ // failed request; give feedback to user $('#ajax-panel').html('

Oops! Try that again in a few moments.

'); } }); } function addMe(LocID, Username, UserID) { $("#add"+LocID).hide(); $("#ajax-loader"+LocID).show(); var returnVal = -1; $.ajax({ type: 'POST', url: 'add.php', data: { UserID: UserID, LocID: LocID }, beforeSend:function(){ // this is where we append a loading image //$('#ajax-panel').html('
Loading...
'); }, success:function(returnVal){ // successful request; do something with the data $("#ajax-loader"+LocID).hide(); $('#ajax-panel').empty(); if (returnVal != 1) { $('#ajax-panel').append("DB update failed! returnVal: " + returnVal); } else { $("#"+LocID).append(''); $("#sub"+LocID).show(); } }, error:function(){ // failed request; give feedback to user $('#ajax-panel').html('

Oops! Try that again in a few moments.

'); } }); } function enableLocation(LocID) { $("#addLoc"+LocID).hide(); $("#ajax-loader"+LocID).show(); var returnVal = -1; $.ajax({ type: 'POST', url: 'enableLocation.php', data: { LocID: LocID }, beforeSend:function(){ // this is where we append a loading image //$('#ajax-panel').html('
Loading...
'); }, success:function(returnVal){ // successful request; do something with the data $("#ajax-loader"+LocID).hide(); //$('#ajax-panel').html(returnVal); $('#ajax-panel').empty(); if (returnVal != 1) { $('#ajax-panel').append("DB update failed! returnVal: " + returnVal); } else { $("#subLoc"+LocID).show(); } }, error:function(){ // failed request; give feedback to user $('#ajax-panel').html('

Oops! Try that again in a few moments.

'); } }); } function disableLocation(LocID) { $("#subLoc"+LocID).hide(); $("#ajax-loader"+LocID).show(); var returnVal = -1; $.ajax({ type: 'POST', url: 'disableLocation.php', data: { LocID: LocID }, beforeSend:function(){ // this is where we append a loading image //$('#ajax-panel').html('
Loading...
'); }, success:function(returnVal){ // successful request; do something with the data $("#ajax-loader"+LocID).hide(); //$('#ajax-panel').html(returnVal); $('#ajax-panel').empty(); if (returnVal != 1) { $('#ajax-panel').append("DB update failed! returnVal: " + returnVal); } else { $("#addLoc"+LocID).show(); } }, error:function(){ // failed request; give feedback to user $('#ajax-panel').html('

Oops! Try that again in a few moments.

'); } }); }