By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,995 Members | 1,088 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,995 IT Pros & Developers. It's quick & easy.

When user clicks BACK, force refresh and auto scroll.

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.