Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] \n -> br and more


  • From: list at tridemail.de (Michael Borchers)
  • Subject: [Javascript] \n -> br and more
  • Date: Tue Mar 28 02:37:54 2006

i have a databased text with \n tags and put them into a function like

...text.value = 'DBTEXT"...

but this DBTEXT has rows (\n), so js turns into:

...text.value = 'DBTEXT

NEXT ROW

ANOTHER';

and js creates an error for that string because it's breaking the source code.

so i chose php to replace \n with <br>:

text.value='DBTEXT<br>NEXT ROW<br>ANOTHER';

works fine, but now the DBTEXT which is parsed into a textarea shows the <br> tags
which isn't that nice.

workaround?
-------------- n?chster Teil --------------
Ein Dateianhang mit HTML-Daten wurde abgetrennt...
URL: http://lists.LaTech.edu/pipermail/javascript/attachments/20060328/2400db55/attachment.html