• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Question about back button in browser

 
Ranch Hand
Posts: 193
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Screaming fools! It's nothing more than a tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic