shortysbest Posted July 13, 2010 Share Posted July 13, 2010 i have a notifications system on my website for friend requests, when someone sends a friend request the user gets a auto-notification, well i have another.load for when the user clicks on the notifications button, a drop down menu displays with the users friend requests, I have "accept" "decline" that i also use jquery to add/decline friend request, however when you get the notification (without reloading page) when you click on accept/decline it doesn't work, then when u reload the page they work, however after i click one of them, if there are multiple requests, the buttons on the other requests don't work until page refresh, But add friend and decline friend both work at same time on the current request. Here's some of my code: reloads the div each 10 seconds. (also have a problem when the time isn't 10 or more seconds, the buttons don't work. setInterval(function (){$j('#notificationbox').load('php/notifications/get_frequests.php');}, 10000); this would be my query to send the decline friend request: $j(function() { $j(".notifications-frequest-decline").click(function(){ var element = $j(this); var noteid = element.attr("id"); var info = 'friend_id=' + noteid; $j.ajax({ type: "POST", url: "php/profile/decline_friend.php", data: info, cache: false, success: function(html){} }); $j(this).html('Friend declined'); return false; }); }); if anyone could help that would be great Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.