469,301 Members | 2,091 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,301 developers. It's quick & easy.

VbCrLf in jscript

Hi!

Im still working on some <%@ LANGUAGE=JScript %> code ;)

What is the same command as VbCrLf in JScript?
I just want my HTML to jump one line down...
hehe

I know I should know... ;)
Jul 19 '05 #1
7 8156
"\n"

--
Roji. P. Thomas
SQL Server Programmer
"Christopher Brandsdal" <br*******@binaer.no> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi!

Im still working on some <%@ LANGUAGE=JScript %> code ;)

What is the same command as VbCrLf in JScript?
I just want my HTML to jump one line down...
hehe

I know I should know... ;)

Jul 19 '05 #2
thanks ;)

"Roji. P. Thomas" <la********@nowhere.com> skrev i melding
news:##**************@TK2MSFTNGP09.phx.gbl...
"\n"

--
Roji. P. Thomas
SQL Server Programmer
"Christopher Brandsdal" <br*******@binaer.no> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi!

Im still working on some <%@ LANGUAGE=JScript %> code ;)

What is the same command as VbCrLf in JScript?
I just want my HTML to jump one line down...
hehe

I know I should know... ;)


Jul 19 '05 #3
"Christopher Brandsdal" <br*******@binaer.no> wrote:
Hi!

Im still working on some <%@ LANGUAGE=JScript %> code ;)

What is the same command as VbCrLf in JScript?
I just want my HTML to jump one line down...
hehe


There's no macro in JScript like VbCrLf. You can use \n for a newline,
but remember that neither VbCrLf nor \n will cause a linebreak that's
visible in your browser. For that, you need to send the HTML tag <BR>.
Or possibly <P> or <DIV>. Browsers ignore things like extra spaces and
newlines in the HTML they are rendering.

--
Tim Slattery
MS MVP(DTS)
Sl********@bls.gov
Jul 19 '05 #4
Tim Slattery wrote on 03 jun 2004 in
microsoft.public.inetserver.asp.general:
"Christopher Brandsdal" <br*******@binaer.no> wrote:
Hi!

Im still working on some <%@ LANGUAGE=JScript %> code ;)

What is the same command as VbCrLf in JScript?
I just want my HTML to jump one line down...
hehe


There's no macro in JScript like VbCrLf. You can use \n for a newline,
but remember that neither VbCrLf nor \n will cause a linebreak that's
visible in your browser. For that, you need to send the HTML tag <BR>.
Or possibly <P> or <DIV>. Browsers ignore things like extra spaces and
newlines in the HTML they are rendering.


However ASP (VBS and JS) can produce far more than HTML content, where
this can be usefull.

vbs [IE]:

myCrLf = chr(10) & chr(13)
alert("a" & myCrLf & "b")

js:

myCrLf = String.fromCharCode(10, 13);
alert('a' + myCrLf + 'b')
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #5
Isn't a true carriage return + line feed represented as \r\n ?

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Roji. P. Thomas" <la********@nowhere.com> wrote in message
news:##**************@TK2MSFTNGP09.phx.gbl...
"\n"

--
Roji. P. Thomas
SQL Server Programmer
"Christopher Brandsdal" <br*******@binaer.no> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi!

Im still working on some <%@ LANGUAGE=JScript %> code ;)

What is the same command as VbCrLf in JScript?
I just want my HTML to jump one line down...
hehe

I know I should know... ;)


Jul 19 '05 #6
Aaron [SQL Server MVP] wrote on 03 jun 2004 in
microsoft.public.inetserver.asp.general:
Isn't a true carriage return + line feed represented as \r\n ?


Under jscript/ASP yes:

<%@Language=Jscript%>
<%

myCrLf = "\r\n"
Response.write(myCrLf.length) // 2

Response.write("<br>")

myLf = "\n"
Response.write(myLf.length) // 1

%>

======================

It could depend on the platform/OS used.
Perhaps some applications could use \n as crlf?

That's why I would play for sure, when I don't know the OS:

String.fromCharCode(10, 13)
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #7

"Tim Slattery" <Sl********@bls.gov> skrev i melding
news:0l********************************@4ax.com...
"Christopher Brandsdal" <br*******@binaer.no> wrote:
Hi!

Im still working on some <%@ LANGUAGE=JScript %> code ;)

What is the same command as VbCrLf in JScript?
I just want my HTML to jump one line down...
hehe
There's no macro in JScript like VbCrLf. You can use \n for a newline,
but remember that neither VbCrLf nor \n will cause a linebreak that's
visible in your browser. For that, you need to send the HTML tag <BR>.
Or possibly <P> or <DIV>. Browsers ignore things like extra spaces and
newlines in the HTML they are rendering.

I know the browser doesn't read the extra space, but that's not what I
needed anyway ;)

Just had to make a line-jump to make my HTML design work perfectly....

--
Tim Slattery
MS MVP(DTS)
Sl********@bls.gov

Jul 19 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

20 posts views Thread by Harag | last post: by
4 posts views Thread by Harag | last post: by
5 posts views Thread by Maxwell2006 | last post: by
14 posts views Thread by dancer | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.