|
-
Feb 24th, 2003, 08:59 PM
#1
Thread Starter
Hyperactive Member
carriage return line feed
How do I do this in JS?
I tried something like
PHP Code:
var Test = "line1" + "\n" + "line2";
but it just put an unprintable char symbol.
-
Feb 24th, 2003, 09:10 PM
#2
Member
You should post your JavaScript and the context in which it is being used, because there's nothing wrong with the line you have.
-
Feb 24th, 2003, 09:53 PM
#3
How about:
var Test
Test = "line1" + "\n" + "line2";
OR
var Test
Test = "line1 <BR> line2";
?
-
Feb 25th, 2003, 01:06 PM
#4
Thread Starter
Hyperactive Member
Well, I am using it with the MSScriptControl. The output text is not HTML. I am just sending it to a textbox object.
VB Code:
'add the tester object
frmMain.objScript.AddObject "objTester", objTesterScript, True
'objScriptContains a textbox object.
Now if I use VBScript like this
VB Code:
objTester.Description = "line1" & vbcrlf & "line2"
then both lines show up in the textbox.
However if I use JavaScript like this
PHP Code:
objTester.Description = "line1" + "\n" + "line2";
then all text appears on one line with an unprintable char between them.
??
-
Feb 25th, 2003, 01:44 PM
#5
Member
\n is the LF portion of CRLF. Try \r\n
-
Feb 25th, 2003, 01:57 PM
#6
Thread Starter
Hyperactive Member
That did the trick. Thanks a lot : )
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|