Javascript and you
Re: Javascript and you
Is that what you use to generate the whois listing live, for the AJAX refresh? That's what it pulls from?
Re: Javascript and you
Obsidian wrote:Is that what you use to generate the whois listing live, for the AJAX refresh? That's what it pulls from?
Yes...from the js file
Code: Select all
// whois chatting Refresh function
stats_refresh : function()
{
// If not custom page...do nothing
if(!mChatCustomWhois)
{
// Stop
return;
}
// AJAX request
$jQ.ajax({
url: mChatFile,
timeout: 10000,
type: 'POST',
async: false,
data: {mode: 'stats'},
dataType: 'html',
success: function(html)
{
// If not empty run its part
if(html != '')
{
// Replace old edited message to new with animation
$jQ('#mChatStats').fadeOut('slow', function(){
// overwrite data to chatting
$jQ('#mChatStats').replaceWith(html);
// Animation ;)
$jQ('#mChatStats').css('display', 'none').fadeIn('slow');
});
}
},
error: function(XMLHttpRequest)
{
if(XMLHttpRequest.status == 403)
{
// No access alert
alert(mChatNoAccess);
}
},
beforeSend: function()
{
// Refresh stop
window.clearInterval(stats_interval);
},
complete: function()
{
// Start refresh
stats_interval = setInterval(function(){mChat.stats_refresh()}, mChatRefresh);
}
});
}
Re: Javascript and you
There is something else that is running within the page that is causing this, looks like. You need to check all your break; calls, see if there is one missing. Also, you may need to introduce a call to exit_handler();
Re: Javascript and you
Damian,
Really want to thank you for sticking with me through this.
[url=http://rmcgirr83.org/mchat/mchat_ajax_mini.js]here is the current js file[/url]
If you wouldn't mind taking a look. It's from taking over the mini chat mod released at phpbb.com but my js skillz are weak and I'm just trying to follow the logic.
It has changed since the last time I code pasted because I was thinking about what you had said about something else already being run...so tried to add the ajax call for the stats within the refresh function of the js file. The result is the same .
FWIW, the php file can be found [url=http://www.rmcgirr83.org/pastebin.php?mode=view&s=8]here[/url].
Really want to thank you for sticking with me through this.
[url=http://rmcgirr83.org/mchat/mchat_ajax_mini.js]here is the current js file[/url]
If you wouldn't mind taking a look. It's from taking over the mini chat mod released at phpbb.com but my js skillz are weak and I'm just trying to follow the logic.
It has changed since the last time I code pasted because I was thinking about what you had said about something else already being run...so tried to add the ajax call for the stats within the refresh function of the js file. The result is the same .
FWIW, the php file can be found [url=http://www.rmcgirr83.org/pastebin.php?mode=view&s=8]here[/url].
Re: Javascript and you
It's more about the PHP file. I checked it directly, and the output included that extra HTML -- somewhere along the line that is getting echoed or something.
Will take a look later -- I have dishes to do.
Will take a look later -- I have dishes to do.
Re: Javascript and you
Obsidian wrote:Will take a look later
Thanks
-- I have dishes to do.
First and last time you will hear me say this...get married.
Re: Javascript and you
Try this? http://phpbbmodders.net/pastebin/view/18/
My comments are marked with //++
Meh.
My comments are marked with //++
RMcGirr83 wrote:First and last time you will hear me say this...get married.
Meh.
Re: Javascript and you
Obsidian wrote:RMcGirr83 wrote:First and last time you will hear me say this...get married.
Meh.
It was another poor attempt by me at a joke.
Anyway, with that code the stats section refreshes once so that's better than what I had but then it doesn't seem to reset/refresh again.
Re: Javascript and you
Odd. That makes me think the JS timer isn't resetting itself now -- you may have caused an issue with JS edits there.
As far as that code goes, just do a diff between my code and yours, and revert back to what you had earlier. That may work out a little better.
As far as that code goes, just do a diff between my code and yours, and revert back to what you had earlier. That may work out a little better.
Re: Javascript and you
Hey Damian,
Just a shout to let you know got it sorted...really appreciate your help btw.
Thanks.
Just a shout to let you know got it sorted...really appreciate your help btw.
Thanks.