javascript – back button query – Education Career Blog

IE & Chrome issue
When i simple click on one field and backit it is properly working but when i filter that field by name or any other than message is display web page expires on clicking on back button

,

There are two types of common web requests

  • POST is meant for those times when you are changing some state on the server (e.g. making a purchase, you wouldn’t want it to get accidentally executed twice)
  • GET is meant for those times when you are querying data but not changing anything; if the request gets submitted twice then there is a bit more load on the server but other than that nothing bad happens.

As a consequence, if you have a page which was retrieved by a POST request (e.g. confirmation of a purchase), and you go BACK to it (or try to refresh it) then in order to redisplay it, the browser will ask for your confirmation before sending the POST a second time, that’s what the warning is about that you’re seeing.

Very often, web forms are written <form method="post"> and are submitted with POST, even if they are not changing any data on the server. This is a mistake. The web browser can’t be certain if you’re changing anything or not (it doesn’t know your server-side code) so it has to ask you if you are sure you want to re-submit the form anyway.

If you are just doing a “filter” operation with the form, i.e. accessing data on the server without changing anything, you need to change the filter form to use <form method="get">.

See http://www.w3.org/TR/html401/interact/forms.html#h-17.13.1 for information from the spec.

(I have had to infer certain things from your question; please excuse me or feel free to clarify your question if you were talking about something else.)

Leave a Comment