Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > VbCrLf in jscript

Reply
Thread Tools

VbCrLf in jscript

 
 
Christopher Brandsdal
Guest
Posts: n/a
 
      06-03-2004
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...


 
Reply With Quote
 
 
 
 
Roji. P. Thomas
Guest
Posts: n/a
 
      06-03-2004
"\n"

--
Roji. P. Thomas
SQL Server Programmer
"Christopher Brandsdal" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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...
>
>



 
Reply With Quote
 
 
 
 
Christopher Brandsdal
Guest
Posts: n/a
 
      06-03-2004
thanks

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

>
>



 
Reply With Quote
 
Tim Slattery
Guest
Posts: n/a
 
      06-03-2004
"Christopher Brandsdal" <(E-Mail Removed)> 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)
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      06-03-2004
Tim Slattery wrote on 03 jun 2004 in
microsoft.public.inetserver.asp.general:

> "Christopher Brandsdal" <(E-Mail Removed)> 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)
 
Reply With Quote
 
Aaron [SQL Server MVP]
Guest
Posts: n/a
 
      06-03-2004
Isn't a true carriage return + line feed represented as \r\n ?

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




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

>
>



 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      06-03-2004
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)
 
Reply With Quote
 
Christopher Brandsdal
Guest
Posts: n/a
 
      06-03-2004

"Tim Slattery" <(E-Mail Removed)> skrev i melding
news:(E-Mail Removed)...
> "Christopher Brandsdal" <(E-Mail Removed)> 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)
> (E-Mail Removed)



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is Server-Side Jscript (not Jscript.NET)? Maxwell2006 ASP .Net 5 03-07-2006 05:28 AM
JScript.Net (JScript 7.0) is official documented language VK Javascript 4 01-12-2006 06:48 PM
Re: Simple question about 'vbCrLf' is not declared Hermit Dave ASP .Net 0 09-21-2004 04:30 PM
Porting from JScript to JScript.Net - compiler error Jon Maz ASP .Net 4 09-09-2004 10:24 AM
Which to Learn: Javascript, Jscript, JScript.NET, ECMA 262 (3rd ed)? John Bentley Javascript 14 02-05-2004 06:14 PM



Advertisments