I save the changes in the editor with ajax, so when I refresh the page or switch from it to another, I get the message "Confirm the transition", but I do not need it. Tell me, please, how to remove it?

  • The "Confirm transition" window means that the POST form has been sent. Accordingly, the answer is: get rid of the POST form (taking into account that you have editing on ajax, if everything is written normally, in theory, nothing should break). - Zowie
  • Yes, no ... There is no form at all. The editor is located simply in the cell of the table, which is in <div>, which is in another block, etc ... Although there is a post form, but the editor is not located in it. - Nikoole
  • In general, on my page there is, besides the editor, which is saved by ajax, there is also one that is sent with the form. Now it dawned on me that it is he who displays this alert ... But how to remove it ... - Nikoole

1 answer 1

@Nikoole - where the form is located does not matter. If it is, then when sending data and trying to refresh the page (or return to it back), you will be asked to send the data again.

In general, since such cases are so important to you, rewrite the form on ajax, or, on the server, when processing data, do redirect (then the window will not be because the page does not load "from zero", respectively, the browser does not knows, many do, but it is a crutch)

  • This is not a crutch, but a common practice. Option 1: the data is sent to the handler page, and it redirects back to the page with the form. Option 2: the data is sent to the same page, the page is not displayed during processing, and redirected to itself with a random parameter to protect against cache. - ling
  • This is a common practice, yes, but it is a crutch - Zowie