our demo environment, let’s see a couple of functions to interact with the user: alert, prompt and confirm… confirm.The syntax:
The function confirm… It returns the text or, if Cancel button or Esc is clicked, null.
confirm
shows a message and waits for
default])
Ask a question, and return either what the visitor entered or null if they clicked “cancel”.
confirm… More in: Interaction: alert, prompt, confirm
ve already seen examples of built-in functions, like alert(message), prompt(message, default) and confirm… In any case, you should have a firm understanding of what a prefix means, what a prefixed function can
example above is that real-life functions use more complex ways to interact with the user than a simple confirm
browsers, including Chrome and Firefox the internal timer continues “ticking” while showing alert/confirm
away from the page or tries to close the window, the beforeunload handler asks for additional confirmation
And, unless the server explicitly confirms that with headers, an unsafe request is not sent.