I have a website having frames. Clicking on button in one frame updates the pages to be loaded in other frames. Now when user press the back button few of the frames load previous pages. i want user not to move back to previous page. I used the code history.forward() on onload event of all my pages. This works fine when back is pressed. User got navigated to most recent page always. But the case is suppose user navigate to number of pages by clicking on button in first frame which updates the pages to be loaded in other frames. After navigation user select a page from the list of browsing history, then it is move forward to only one page, not t开发者_开发技巧he last page he was viewing. This Happens in IE. In firefox it works fine. User can select any page from the browsing history, he is relocated to most recent page
My opinion is, you should review your concept, because you want to "reconfigure" the browser's navigation buttons. Disabling browser features is in my eyes old fashioned.
I used the code history.forward() on onload event
Try following this way:
In the head section, insert the javascript:
var historySize = history.length;
Then replace in onload
event: history.forward()
by history.go(historySize - 1)
. A positive value means move forward to a particular position in browser's history object (array).
I cannot guarantee that it will work, but it is worth to try out.
write this code between script tags
history.pushState(null, null, location.href);
window.onpopstate = function () {
history.go(1);
};
精彩评论