Using Jquery for my friends system.
Hey there all, I've been busy with this for a while and I'm trying to learn Jquery but I just can't get it right.
I currently have the following code for my add friend and delete friend.
<?php if($user->isfriend($_SESSION['GoT_username'], $userinfo['user_id'])){ ?>
<a href="index.php?act=delfriend&friend=<?= $userinfo['user_id'] ?>" title="Vriend verwijderen"><img src="images/Error-32.png" height="20" width="20"></a>
<?php }else{ ?>
<a href="index.php?act=addfriend&friend=<?= $userinfo['user_id'] ?>" title="Als vriend toevoegen"><img src="images/Add-32.png" height="20" width="20"></a>
Basically what I do is I feed the friendid to the url and my script handles this and echo's a add friend was successful.
I however fail to get this going in Jquery (like making a function out of it which correctly executes my script with the correct data and changing the addfriend icon to delfriend icon.
Can someone please get me going?