HTMLGuyLLC / jAlert

jQuery alert/modal/lightbox plugin
https://htmlguyllc.github.io/jAlert/
MIT License
76 stars 35 forks source link

Line breaks not working in jAlerts. #22

Closed Bluscream closed 8 years ago

Bluscream commented 8 years ago

I can't use line breaks in a alert. Thats sad :c

s

infoAlert("\""+ username +"\"s Info","Name: "+username+"\\n"+"\n"+"ID: " + id);
Bluscream commented 8 years ago

Also

$.jAlert({
    'title': username +'\'s Info',
    'content': 'Name: '+username+'\n'+'UID: '+id,
    'theme': 'blue',
    'size': 'md',
    'showAnimation': 'fadeInUp',
    'hideAnimation': 'fadeOutDown' 
});

Does not work.

HTMLGuyLLC commented 8 years ago

You can. This is HTML. Just use

<br>
Bluscream commented 8 years ago

OMG thanks ^^ You should mention that somewhere ^^

Cause https://www.google.de/search?q=jalert+multiline+alerts and https://www.google.de/search?q=jalert+linebreak bring confusing results :)

HTMLGuyLLC commented 8 years ago

There's a big difference between a plain javascript alert and my plugin. Javascript alerts using the plain alert() function require \n for new lines because they don't show HTML as-is. My alert is a simple div and whatever content you enter will be rendered as normal HTML is.

Bluscream commented 8 years ago

So i could even use a <table> inside of it? :D

HTMLGuyLLC commented 8 years ago

Lol yes.