8
Are there other ways to change the Alert display? for example when using \n
he breaks the line, I wonder if there are other commands of those that I can modify the text display, for example leave a sentence in bold and etc
alert('Texto\n Linha de baixo');
I know I could use a custom Alert using divs
and such, but I was really curious about the alert()
Most interesting example
alert('Error:\n\n\tPrint plugin is loaded but NOT active!');
They realize that the text Print plugin is loaded but NOT active!
gets a different format
Wouldn’t it be better to create a
dialog
customized?– Felipe Avelar
@Felipeavelar would be better, but I’m curious about that ;)
– Silvio Andorinha
@Silvioandorinha, I was also curious, but researching seems that it does not apply any type of styles to
alert
native, as informed in this question.– Fernando Leal
Good question! I think that can not do much, no, and I thank heaven for it (the functions
alert
,confirm
andprompt
should be extinguished, they are a nightmare for security and usability...).– mgibsonbr
@Fernando and @mgibsonbr Look how interesting the example I found, click to execute the text of the code
alert
gets a different color– Silvio Andorinha
I believe there is no command for the
alert
, the\n
is converted to a character line break when placing in a string, ie thealert
just displays the string, without formatting anything.– Oeslei
You can use other special characters that are converted when using in a string, such as the tab character
\t
or even icons, such as\u2605
.alert("teste \u2605\n\tlegal");
– Oeslei