Hi all,
Sorry if this problem has been posted and solved before, I've tried searching but am stuck.
I have database that displays results. These results are called using .load() into a Div.
Here is my jQuery code
- <div id="ajaxresults">
- <a href="calllog.php?hire=<?php echo $id; ?>" class="glink">View Call Log</a>
- </div>
The fadeIn doesn't work and I'm guessing because 'this' no longer exists after it is replaced with the aJax called content.
- $("a.glink").live("click", function(event) {
event.preventDefault();
var url=$(this).attr("href");
$(this).parent().append('<span><img src="images/ajax-loader.gif" /></span>');
$(this).parent().load(url,'', function(){
$(this).parent().fadeIn("slow");
}); //End of Ajax Call
});
Having code that fades the ajaxresults div isn't good enough because there are multiple ajaxreults divs on the page depending on the results of the database.
So I just need the parent div of the link that has been clicked.
Any help is much appreciated.
Regards
James