javascript page refresh... expert advice appreciated...
Posted: Mon Jul 20, 2009 10:20 pm
Hey guys I am using a Jquery ajax function to update a page section however every time the page refreshes I lose the spot where the scroll bar was and it returns to the top. Is there anyway to fix this based on my code? I do not know where else to turn I have tried everything. Any advice will do, here is my script.
Then I tried this call however the page just keeps refreshing in a fashion that is useless since the scroll bar resets
Code: Select all
function updatebox(){
//just for the fade effect
messageList.hide();
loading.fadeIn();
//send the post to box.php
var topic_id = inputid.attr("value");
$.ajax({
type: "POST", url: "shoutter/shoutbox.php", data: "action=update&id=" + id,
complete: function(data){
loading.fadeOut();
messageList.html(data.responseText);
messageList.fadeIn(2000);
}
});
}Code: Select all
setInterval(updatebox, 3000);