Possibly reversing the order may work:
Code:
ajaxpageclass.loadpage=function(page_request, divId){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
var t = document.getElementById(divId);
if(t.scrollTop){
t.scrollTop = 0;
}
if(t.scrollTo){
t.scrollTo(0, 0);
}
t.innerHTML=page_request.responseText;
}
};
However, it's also possible it already worked and you were simply viewing an old cached version, or that you didn't actually make the change to the page you then later tested on, or that there is something peculiar about your layout and/or setup that is preventing this from working, or I may not have understood the situation.
Bottom line, since this didn't work for you, if the above code and/or information doesn't lead you to a solution, all I can do without seeing the page is guess. That's too time consuming.
So, if you want more help:
Please post a link to a page on your site that contains the problematic code so we can check it out.
Bookmarks