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('

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('
');
$("#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('
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('
Oops! Try that again in a few moments.
'); } }); }