[fwd] [thelist] Replacing Carriage returns in Javascript

Dave Dufour dave at du4.com
Mon Sep 17 21:04:44 CDT 2001


This is a remote scripting application that will only be viewed in IE 5.5,
so I'm not worried about other browsers.  No, it's not publicly accessible.
I'm passing values via javascript to an Active Server Pages remote script
and if there are any carriage returns in the text being passed, the ASP
function receiving it bombs.  No problem if the carriage returns are
removed.  So, I figured a simple replace would solve the problem, but I
cannot find the appropriate code to specify a carriage return in the
string.replace function.

>-----Original Message-----
>From: thelist-admin at lists.evolt.org
>[mailto:thelist-admin at lists.evolt.org]On Behalf Of .jeff
>Sent: Monday, September 17, 2001 8:59 PM
>To: thelist at lists.evolt.org
>Subject: RE: [fwd] [thelist] Replacing Carriage returns in Javascript
>
>
>dave,
>
>><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
>> From: Dave Dufour
>>
>> I have an application in which I need to replace
>> carriage returns/line feeds with a little-used
>> character that can be converted back by another
>> script.
>><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
>
>what, per chance, is the need to convert carriage returns and
>line feeds?
>
>><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
>> I know about the string.replace() function, [...]
>><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
>
>is this publicly accessible?
>
>what level of browser are you looking to support?
>
>what are you planning on doing to make sure it doesn't throw errors on
>browsers that don't support the replace() method?
>
>><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
>> [...] but I have no idea how to refer to carriage
>> returns and line feeds.  In VBScript there is CHR(10)
>> and CHR(13).  What is the equivalent in Javascript?
>><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
>
>\n
>
>good luck,
>
>.jeff
>
>http://evolt.org/
>jeff at members.evolt.org
>http://members.evolt.org/jeff/
>
>
>
>---------------------------------------
>For unsubscribe and other options, including
>the Tip Harvester and archive of TheList go to:
>http://lists.evolt.org Workers of the Web, evolt !
>





More information about the thelist mailing list