I am writing a messaging system with jquery. When you click on a thread title with the class '.open_message', It opens a thread with all the messages for that thread via Ajax. My issue is that when the thread title is clicked it is not recognizing the id attribute for that specific thread title in firefox and IE. It works fine in chrome, though. Here is the code:
$('.open_message').on('click', function(e) {
$(this).parent().removeClass('unread');
$(this).parent().addClass('read');
$('.message_container').html('');
var theID = e.currentTarget.attributes[0].value;
theID = theID.replace('#', '');
var url = '".$url."';
var dataString = 'thread_id=' + theID;
$('.message_container').append('<img id=\"loading\" src=\"' + url + '/images/loading.gif\" width=\"30px\" />');
$.ajax({
type: 'POST',
url: 'get_thread.php',
data: dataString,
success: function(result) {
$('#loading').hide();
$('.message_container').append(result);
}
});
return false;
});
Thanks for the help!