Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] \n -> br and more
- From: paul at novitskisoftware.com (Paul Novitski)
- Subject: [Javascript] \n -> br and more
- Date: Tue Mar 28 03:04:29 2006
At 12:38 AM 3/28/2006, Michael Borchers wrote:
>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.
Michael, this seems like a server-side script issue, not a JavaScript
issue. What language are you using? PHP?
Perhaps you could escape the backslashes in your database:
DBTEXT\\nNEXT ROW\\nANOTHER
to output:
...text.value = 'DBTEXT\nNEXT ROW\nANOTHER';
Paul
- References:
- [Javascript] \n -> br and more
- From: Michael Borchers
- [Javascript] \n -> br and more
- Prev by Date: [Javascript] \n -> br and more
- Next by Date: [Javascript] in need of pointers...
- Previous by thread: [Javascript] \n -> br and more
- Next by thread: [Javascript] Event question and finding pointer position at event
- Index(es):