Closed
Bug 181360
Opened 22 years ago
Closed 22 years ago
calling the alert() function does not parse html, including <BR> tags
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
VERIFIED
INVALID
People
(Reporter: mfahey, Assigned: rogerl)
Details
User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; FreeBSD 4.6-STABLE i386) Opera 6.1 [en] Build Identifier: Mozilla/5.0 (X11; U; Linux i386; en-US; rv:1.0.0) Gecko/20020529 <script language="JAVASCRIPT"> alert('this is the first message. <BR> This is the second. <BR> This is the thir'); </script> The following outputs the <BR> instead of parsing them. how do you format text when using the alert function? Reproducible: Always Steps to Reproduce: 1. 2. 3.
Comment 1•22 years ago
|
||
You use newlines (\n in JS strings). The text in an alert is just that -- text. It's not HTML.
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
Comment 2•22 years ago
|
||
Verified Invalid. Once you are in JavaScript (and not HTML), newlines are specified with "\n". Just try this: <script language="JAVASCRIPT"> alert('This is the first message.\nThis is the second.\nThis is the third'); </script>
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•