PDA

View Full Version : jQuery AJAX callback issues



unikrl8
April 10th, 2009, 04:27 AM
I want to make links disappear when the ajax call underneath them returns successful.
I can't figure out how to access the $(this) .... or whatever it needs to be .... to get back to the $("a") jquery object.

I have put alerts in the callback and it IS running.

What do I do?



$("a").click(function(){
var content = $(this).html();

$.post("process.php", { filename: content},
function(data){
$(this).hide(); //<<<<THIS IS WHERE I NEED HELP
});

});
Thanks in advance for any help you can provide :)
-Karl

mattrock23
April 11th, 2009, 01:28 AM
Hey, I just recently had a similar problem. Or at least a project that included this problem.

http://www.kirupa.com/forum/showthread.php?t=323083