• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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.
 
That new kid is a freak. Show him this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic