Right now you click on a link, it send ajax call and on success it prepends the output in . Not i would like to, if you click on the link while its open then it should close/hide the output.
function MoreFriendOptions(friend){
$.ajax({
type: "POST",
url: "misc/GetMoreFriend.php",
data: {
mode: 'ajax',
friend : friend
},
success: function(msg){
$('#MoreFriendInfo'+friend).prepend(msg);
}
});
}
echo "<div id='MoreFriendInfo".$showInfo['bID']."'></div>";
<div style="float: right;">
<a href="javascript:void(0);" onclick="MoreFriendOptions(<?=$showInfo["bID"];?>)">mer</a>
</div>