Hello,
I do apologize if this is in the wrong forum...
I've written this Ajax script to process a request to remove data from a MySQL database, however they are both on the server but it doesn't seem to do the process whatsoever so it's baffled me
Here's my Ajax script:
And for the part that sends the request to the Ajax script is thisCode:<script type="text/javascript"> //--> function removeBuddy(bud) { $.ajax({ type: "GET", url: "removeBuddy.php", data: "buddy="+ bud, success: function(msg){ $("#removed").ajaxComplete(function(event, request, settings){ if(msg == 'OK') { $("#removed").css("padding", "10px", "font-size", "8pt"); $(this).html(' You have successfully removed <b>'+ bud +'</b> from your buddy list...'); } else { $("#removed").css("padding", "10px", "font-size", "8pt"); $(this).html(msg); }); } }); } else { $("#removed").css("padding", "10px", "font-size", "8pt"); $("#removed").html('FATAL: There was an error while processing your request... Please try again'); } }); }); } //--> </script>
Also the DIV that returns the message is this:HTML Code:<a href="#" onclick="removeBuddy('User1');">Delete Now...</a>
Can someone please be kindly and help me solve this, any help will be much appreciatedCode:<div id="removed"></div>![]()




Reply With Quote



Bookmarks