Skip to main content
1 of 4
Crono
  • 1.7k
  • 15
  • 24

The short answer is that the client never knows to send request to server unless the client code make that happen. Whatever happens when the user clicks OK or Cancel is up to you, and you alone. It's your responsibility to react on user input and take the appropriate action. The browser will not take any initiatives for you there.

Usually your presentation layer will show confirmation dialogs with javascript and wait for input. When the user makes a choice, it gets processed by the code and the next step is executed depending on the choice. Again, remember that whatever happens then is up to you. For all there is, you could very well end up having the "Cancel" button click making a server request. There might be a very good reason for that: rollbacking an on-going transaction, going back to a specific page... it really all depends on your app design and requirements.

Crono
  • 1.7k
  • 15
  • 24