I'm trying to get some text to display in a div
. This div
will appear many times on the page so targeting an ID is out.
This works: it displays the message in the div.
$('.join-div .content a').click(function() {
$(this).parent().siblings('.message').html('THIS IS A TEST');
});
This does not
$('.join-div .content a').click(function() {
var data = 'foo=bar';
$.post('/assets/ajax/join.php',data, function(response) {
$(this).parent().siblings('.message').html('THIS IS A TEST');
});
});
I'm not receiving any errors in the console and the php script works; it returns a response and I can alert()
it. It looks like $.post
is interfering somehow but I can't figure it out.