How do I do this in JS?
I tried something like
but it just put an unprintable char symbol.PHP Code:var Test = "line1" + "\n" + "line2";
Printable View
How do I do this in JS?
I tried something like
but it just put an unprintable char symbol.PHP Code:var Test = "line1" + "\n" + "line2";
You should post your JavaScript and the context in which it is being used, because there's nothing wrong with the line you have.
How about:
var Test
Test = "line1" + "\n" + "line2";
OR
var Test
Test = "line1 <BR> line2";
?
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
then both lines show up in the textbox.VB Code:
objTester.Description = "line1" & vbcrlf & "line2"
However if I use JavaScript like this
then all text appears on one line with an unprintable char between them.PHP Code:objTester.Description = "line1" + "\n" + "line2";
??
\n is the LF portion of CRLF. Try \r\n
That did the trick. Thanks a lot : )