Styling up window alerts and adding content for entire site

No - some browsers offer the option to turn off JavaScript in EVERY alert() confirm() and prompt() including the very first.

The following was the way the first alert on any page used to appear in my browser before I turned alert off completely.

I agree that it isn’t the best way to do debugging but it serves no other purpose whatsoever. Debugging is the only thing that you can use alert() for.

So given that it can’t be used for anything but debugging and we are in agreement that there are better alternatives to use for debugging that presumably means that you now agree with me that it is DEAD.

Or are you arguing that it should be used to give people an easier way to turn off JavaScript for a specific web page (assuming that they are using a browser that displays that checkbox on all dialogs)?

Anyway, getting back to the OP’s question - the only way to style the built in dialogs IS to override them. That’s one of the reasons that no one who has taken JavaScript 101 ever uses them any more.

I will agree that there isn’t much point in overriding them because that will not achieve anything if your visitor has turned the dialogs off. You might get away with overriding it for most visitors at the moment as not many will have them turned off but given how they generally only appear now when people have forgotten to remove debugging calls before uploading their script the number of people turning them off will probably grow as time goes on.

As a side note, this will cause things to fail in earlier versions of IE if you don’t have the console open.

If you are debugging you would presumably have the console open so you can see the messages so correct use of console.log for debugging shouldn’t cause a problem. It isn’t like you are going to leave debugging calls such as alert() or console.log() in your page when it goes live so you know exactly which browser you are running the commands with and how that browser is going to treat those calls.

So if you are using an earlier version of IE where using console.log will cause things to fail if the console isn’t open then you will very quickly realise that you forgot to open the console.

This does provide a good reason for making sure all the debugging calls are turned off before your script goes live - just as the checkbox to turn off JavaScript that appears in all alerts issued by some browsers is a good reason for removing all the alerts if you use them for debugging instead of console.log.