1

Possible Duplicate:
Change the native confirm/alert

alert("hello")

Is there anyway to change the style of the default alert box rather than providing the user with the same old windows feel..

Community
  • 1
  • 1
user824910
  • 1,067
  • 6
  • 16
  • 38

6 Answers6

1

No, this is hardcoded to the browser. I use jQuery UI dialogs rather than alerts, they're easily customizable:

http://jqueryui.com/demos/dialog/

Raoul
  • 3,849
  • 3
  • 24
  • 30
0

As far as i know there are no ways to change the style of the default alert box. It is styled from the browser (in firefox 4 and > it's much nicer)

Nicola Peluchetti
  • 76,206
  • 31
  • 145
  • 192
0

You can't change the alert window style, its depend on OS and Browser. If you want to change the look and feel you need to use Javascript Model windows like JQuery Dialogs

Anuraj
  • 18,859
  • 7
  • 53
  • 79
0

Just use a jQuery UI Dialog. You can't customize the default dialog and it's entirely up to the browser as to how that looks.

Josh
  • 68,005
  • 14
  • 144
  • 156
0

It is absolutly relative to the browser used. You can't change it.

The common workaround is using a div over a darkened background. Look for lightbox CSS usage.

monsieur_h
  • 1,360
  • 1
  • 10
  • 20
-5

Provide the user with a new operating system.

davin
  • 44,863
  • 9
  • 78
  • 78
  • Operating system? This won't matter since this is Browser dependent rather than OS dependent – Raoul Jul 01 '11 at 13:13
  • I think it was supposed to be a joke. – marchaos Jul 01 '11 at 13:15
  • @Raoul, firstly, a different OS means a different browser. The browser may come under the same name but the software is certainly different. Secondly, where's your sense of humour? Clearly my response was the the OP's comment of not wanting "the same old windows feel". – davin Jul 01 '11 at 13:15
  • Aahh, I love posts like these, my vote count ends up being `+` those with a sense of humour `-` those without. Which says something about this community considering the count. – davin Jul 01 '11 at 13:16
  • @davin `firstly, a different OS is a different browser.` an Operating system is **not** a web browser. Linux isn't a browser, Windows 7 isn't a browser. They may ship with web browsers but they're definitely not the same thing, which is why they have different names. – Raoul Jul 01 '11 at 13:17
  • @Raoul, I think you got stuck on the pre-edited comment and decided to nitpick on my word choice. Read my comment again. Although thanks for the info, invaluable. – davin Jul 01 '11 at 13:22
  • @davin you changed it to `firstly, a different OS means a different browser.` this still isn't true! http://en.wikipedia.org/wiki/Operating_system and http://en.wikipedia.org/wiki/Web_browser and no, when I posted, there was no edit, which is why I could copy and paste your quote. – Raoul Jul 01 '11 at 13:30