Div populates from Ajax query...then doesn't
Hello,
Real jquery nub and javascript as well but at least trying.
I have the following code within a js
-
// AJAX request
$jQ.ajax({
url: mChatFile,
timeout: 10000,
type: 'POST',
async: false,
data: {mode: 'stats'},
dataType: 'html',
success: function(html)
{
// Replace old stats with animation
$jQ('#mChatStats').fadeOut('slow', function(){
// overwrite data to stats
$jQ('#mChatStats').replaceWith(html);
// Animation ;)
$jQ('#mChatStats').fadeIn('slow');
});
},
and it works fine...that is the information (according to firebug) is showing fine. I have it refreshing every 6.5 seconds and the first run of the refresh populates the div in the html perfectly. All subsequent ones though do not.
-
<!-- IF MCHAT_CUSTOM_PAGE and MCHAT_CUSTOM_PAGE_WHOIS -->
<h3>{L_WHO_IS_CHATTING}</h3>
<p>{MCHAT_TOTAL_USERS_ONLINE} <br />{MCHAT_LOGGED_IN_USER_LIST}</p>
<div id="mChatStats" style="display:block"></div>
<!-- IF LEGEND --><p><em>{L_LEGEND}: {LEGEND}</em><!-- ENDIF --></p>
<!-- ENDIF -->
Why doesn't the div #mChatStats continue to change depending on what is pulled by the ajax query?
TIA for any suggestions or insight.
You can see the entire thing
here