calling the alert() function does not parse html, including <BR> tags

VERIFIED INVALID

Status

()

Core
JavaScript Engine
VERIFIED INVALID
16 years ago
16 years ago

People

(Reporter: mfahey, Assigned: rogerl (gone))

Tracking

Trunk
x86
FreeBSD
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

16 years ago
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.
You use newlines (\n in JS strings).  The text in an alert is just that -- text.
 It's not HTML.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → INVALID

Comment 2

16 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.