I'm being unsuccessful creating an alert with line breaks. I'm new to jQuery so I'm sure I'm missing something simple, which I'm also not finding via web searches.
j开发者_C百科qAlert({ text: 'The item:\n\n ' + item.description + '\n\nhas already been added.', title: 'Duplicate Entry' });
I have also tried using \r.
Replace \n
with <br/>
and tell me if it worked for you.
You tried using <br />
? I would guess that it is actually rendering a html popup.
精彩评论