Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #31754

Re: Replacing javascript line break (\n) with HTML line break (<br/>)

Newsgroups comp.lang.javascript
Subject Re: Replacing javascript line break (\n) with HTML line break (<br/>)
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References <dc07c4cd-7623-42e4-abe0-972601884ec3@googlegroups.com> <XnsA6D16E788D90Eeejj99@194.109.6.166> <ec8aab6f-eddb-4859-86b8-876bd2d3ebec@googlegroups.com>
Date 2016-12-01 16:41 +0100
Message-ID <XnsA6D1A9DC45A02eejj99@194.109.6.166> (permalink)

Show all headers | View raw


justaguy <lichunshen84@gmail.com> wrote on 01 Dec 2016 in
comp.lang.javascript: 

> Good catch on the XML and HTML part for the line break!
> But both of them should work for this purpose.

That is NOT a catch, 
and is does not mean it will not work,
because browsers are developed to be forgiving,
more forgiving than I am.

Crossing the motorway blindfolded could leave you unblamished too.

However,you are just mistaken in saying:

>> >  turn js line breaks inside HTML Textarea tag into HTML line breaks


> Probably I wasn't clear. The page has about 5 elements using Textarea
> and all of them references the same js function.  So, for instance, a
> Textarea element with id of 'legalStuff', I'll call up the js function
> of lb with lb('legalStuff') and another Textarea element of id of
> 'shortDesc' with lb('shortDesc'). 

Well yes, we are not in the business of providing you with all the code,
my code is just an example for you to understand what is possible.

> Firefox ver 50 is a modern browser, isn't it? 

I am not interested in that. I want you to learn by applying and testing 
your own code, so that your Qs on this NG become more challenging that at 
the present.

If you expect to get code that works to your specifications as-is,
you better hire a professional programmer.


-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Replacing javascript line break (\n) with HTML line break (<br/>) justaguy <lichunshen84@gmail.com> - 2016-11-30 19:15 -0800
  Re: Replacing javascript line break (\n) with HTML line break (<br/>) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-12-01 10:51 +0100
    Re: Replacing javascript line break (\n) with HTML line break (<br/>) justaguy <lichunshen84@gmail.com> - 2016-12-01 05:55 -0800
      Re: Replacing javascript line break (\n) with HTML line break (<br/>) justaguy <lichunshen84@gmail.com> - 2016-12-01 05:59 -0800
      Re: Replacing javascript line break (\n) with HTML line break (<br/>) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-12-01 16:41 +0100
    Re: Replacing javascript line break (\n) with HTML line break (<br/>) Cybercode <lambda@dr.com> - 2016-12-01 17:49 +0000
      Re: Replacing javascript line break (\n) with HTML line break (<br/>) justaguy <lichunshen84@gmail.com> - 2016-12-01 13:09 -0800
      Re: Replacing javascript line break (\n) with HTML line break (<br/>) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-12-01 23:13 +0100
        Re: Replacing javascript line break (\n) with HTML line break (<br/>) rmmjr@rmmillerjr.com - 2016-12-11 07:10 -0800
          Re: Replacing javascript line break (\n) with HTML line break (<br/>) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-12-11 16:53 +0100
        Re: Replacing javascript line break (\n) with HTML line break (<br/>) rmmjr@rmmillerjr.com - 2016-12-11 07:10 -0800

csiph-web