Jump to content

main page moves to the top on ajax reload


neilh

Recommended Posts

Hello, I have a live stats box on my website which reloads every 6 seconds. Here's the code for the bit which does this,

// Page Load Events
function livestats() {
MyAjaxRequest('onlinestats_ajax','/onlinestats.php');
setTimeout(livestats,6000);
}
function pageLoad() {
livestats();	
}

the pageLoad() function is called in the body tag when the main page loads, and then the DIV which the ajax is loaded into shows the content.

However if you have scrolled down the page after 6 seconds the page goes back up to the top. Now i can't work out why this is happening.

If you want to see the Ajax JS file then here it is -> http://phptut.jungledog.co.uk/themes/default/ajax.js

If you can help me sort this out it would be most appreciated!

 

Thanks,

Neil

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.