neilh Posted February 11, 2007 Share Posted February 11, 2007 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 Link to comment https://forums.phpfreaks.com/topic/38064-main-page-moves-to-the-top-on-ajax-reload/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.