1

I came across this question referring to alerts and confirm dialogs, like the one created by alert('Hello World!'), while searching for a way to change the text in the 'ok' and 'cancel' buttons (there isn't one). That question, or rather, an answer to that question, indicated that somehow the OS is used to generate the confirm boxes, rather than the browser.

I've hear them referred to as 'native' before, but I had assumed that meant that the dialogs were native to the browser, not the OS.

My question is, what exactly determines the rendering of these dialogs? Is it the operating system, the browser, or some combination of the two? Does the browser handle these on its own, or does it ask the OS to display a dialog, and then catch the result of that?

Community
  • 1
  • 1
ckersch
  • 7,507
  • 2
  • 37
  • 44

1 Answers1

1

It's totally up to the implementation within the browser how the alert dialog is created/rendered and different browsers likely do it differently as it is not something that is specified by any standards nor does it need to be. I would expect Firefox to probably use it's own cross-platform XUL tech to render it (just an educated guess). I'd expect IE to use native OS stuff.

The main idea behind those dialogs is that they block execution of javascript (they are blocking prompts) and they are not customizable beyond what the function interface provides.

jfriend00
  • 683,504
  • 96
  • 985
  • 979