On the surface, the job is simple. All we have to do is call history.forward() and we're done! Unfortunately, there's a big catch: exactly how and when are we going to call it?
Calling history.forward() from the onLoad handler of the body element sounds like a no-brainer, doesn't it! Unfortunately, many web browsers do not call onLoad when the user backs up to a page. Examples include Safari, Opera, and Firefox (in some situations and not others).
Working Around the onLoad Problem
But how does setTimeout help us? It's very simple. The first time the page loads, onLoad is always called. And we use that to set up our timer... which tries to move forward to the next page in the browser history once every quarter-second. If it can't, we're already on the newest page - not a problem!
So what happens when the user backs up? If they are
Chilverupavan, if this helps please login to Mark As Answer. | Alert Moderator