• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about back button in browser

 
Jane Somerfield
Ranch Hand
Posts: 193
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I click the back arrow button in a browser,
the previous page is displayed again.
Where is the "previous" page from? Browser cache or
reloaded from server? Is there a way to disable the back button in
HTML?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Last question first: No, you can not disable the back button (thankfully).

Answer to the first question: It depends.
If the page is cached in the browser, you will usually see the cached version.
If not, the browser will make a new request to get the data.

If the data was the result of a request of type POST, the browser will warn the user that the form will be re-submitted in order to recreate the page.
 
Candi So
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the insight.

The scenario is that on my form, there's a field which could be populated by a search function written in javascript, or by typing in the value directly. If the value is typed in directly, the Back button will show the form with the value. However, if it's populated by the javascript, the form will be initialized. Actually, if I run it in debug mode, I see that the URL is triggered again, so all the initialization happens again.

The goal is to see the page with the populated value when the Back button is hit. So, my question is how could I do that?

Your help is much appreciated.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic