VbCrLf in jscript

Discussion in 'ASP General' started by Christopher Brandsdal, Jun 3, 2004.

  1. 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... ;)
     
    Christopher Brandsdal, Jun 3, 2004
    #1
    1. Advertising

  2. "\n"

    --
    Roji. P. Thomas
    SQL Server Programmer
    "Christopher Brandsdal" <> wrote in message
    news:%...
    > 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... ;)
    >
    >
     
    Roji. P. Thomas, Jun 3, 2004
    #2
    1. Advertising

  3. thanks ;)

    "Roji. P. Thomas" <> skrev i melding
    news:##...
    > "\n"
    >
    > --
    > Roji. P. Thomas
    > SQL Server Programmer
    > "Christopher Brandsdal" <> wrote in message
    > news:%...
    > > 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... ;)
    > >
    > >

    >
    >
     
    Christopher Brandsdal, Jun 3, 2004
    #3
  4. Christopher Brandsdal

    Tim Slattery Guest

    "Christopher Brandsdal" <> 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)
     
    Tim Slattery, Jun 3, 2004
    #4
  5. Christopher Brandsdal

    Evertjan. Guest

    Tim Slattery wrote on 03 jun 2004 in
    microsoft.public.inetserver.asp.general:

    > "Christopher Brandsdal" <> 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)
     
    Evertjan., Jun 3, 2004
    #5
  6. Isn't a true carriage return + line feed represented as \r\n ?

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




    "Roji. P. Thomas" <> wrote in message
    news:##...
    > "\n"
    >
    > --
    > Roji. P. Thomas
    > SQL Server Programmer
    > "Christopher Brandsdal" <> wrote in message
    > news:%...
    > > 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... ;)
    > >
    > >

    >
    >
     
    Aaron [SQL Server MVP], Jun 3, 2004
    #6
  7. Christopher Brandsdal

    Evertjan. Guest

    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)
     
    Evertjan., Jun 3, 2004
    #7
  8. "Tim Slattery" <> skrev i melding
    news:...
    > "Christopher Brandsdal" <> 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)
    >
     
    Christopher Brandsdal, Jun 3, 2004
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jon Maz
    Replies:
    4
    Views:
    1,277
    Jon Maz
    Sep 9, 2004
  2. Hermit Dave
    Replies:
    0
    Views:
    395
    Hermit Dave
    Sep 21, 2004
  3. Maxwell2006
    Replies:
    5
    Views:
    2,399
    Steven Cheng[MSFT]
    Mar 7, 2006
  4. John Bentley
    Replies:
    14
    Views:
    353
    Jim Ley
    Feb 5, 2004
  5. VK
    Replies:
    4
    Views:
    356
    Thomas 'PointedEars' Lahn
    Jan 12, 2006
Loading...

Share This Page