471,596 Members | 926 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,596 software developers and data experts.

When user clicks BACK, force refresh and auto scroll.

Hello,

I have an application which should never allow the back button to be pushed
without refreshing the previous page. For example:

Step 1:
User fills in form.html and presses submit

Step 2:
User see's results.html and clicks back to amend form

Step 3:
form.html MUST REFRESH ONCE and only once, which will do a few things on my
server before reloading the page.

Step 4:
After refresh, the page should SCROLL to the top of the page automatically

Pseudo Style:

If window.history.forward(1) exists
then
refresh this page and scroll to top
else
do nothing

I wonder if the following script can be modified to achieve my goal:

<script language="JavaScript"><!--
javascript:window.history.forward(1);
//--></script>

Any help greatly appreciated.

Badass.
Apr 26 '06 #1
1 6587
Badass Scotsman said the following on 4/26/2006 10:37 AM:
Hello,

I have an application which should never allow the back button to be pushed
without refreshing the previous page. For example:
Then your application is broken.
Step 1:
User fills in form.html and presses submit

Step 2:
User see's results.html and clicks back to amend form

Step 3:
form.html MUST REFRESH ONCE and only once, which will do a few things on my
server before reloading the page.
Set a cookie.
Step 4:
After refresh, the page should SCROLL to the top of the page automatically
Ummm, set the hash property of the location then.
Pseudo Style:

If window.history.forward(1) exists
then
refresh this page and scroll to top
else
do nothing
First, nothing in my History trail (if anything) is relevant or accessible.

Second. If I view your form and click a Favorites and navigate away
(without submitting the form), then click the Back button, your server
is gonna be hosed.
I wonder if the following script can be modified to achieve my goal:

<script language="JavaScript"><!--
javascript:window.history.forward(1);
//--></script>


Modified or scratched and start over?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Apr 27 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Mark | last post: by
14 posts views Thread by Simon Wigzell | last post: by
5 posts views Thread by antonyliu2002 | last post: by
4 posts views Thread by morc | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.