Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] js for inserting a \n every 80 chars?
- From: wdlists at triche-osborne.com (Triche Osborne)
- Subject: [Javascript] js for inserting a \n every 80 chars?
- Date: Fri Dec 29 12:00:32 2006
LIFO: Matt Murphy wrote: > > Is there somewhere I can go to look up javascript functions? http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide > Is there a javascript version of str_replace()? > string.replace( regexp, replacement ) > I have a script that takes user input from a textarea and dumps it into > a <pre> element in a new table cell. The problem is if you type in a > long sentance with no breaks, the <pre> will not allow it to wrap, and > it'll make the table super wide. I'm wondering if there's a javascript > function that will allow me to insert a \n every 80 characters? > Not built-in, no. If you build your own, you may want to refine it so that it breaks on the nearest space rather than exactly at 80. Triche
- Follow-Ups:
- [Javascript] js for inserting a \n every 80 chars?
- From: Matt Murphy
- [Javascript] js for inserting a \n every 80 chars?
- References:
- [Javascript] js for inserting a \n every 80 chars?
- From: Matt Murphy
- [Javascript] js for inserting a \n every 80 chars?
- Prev by Date: [Javascript] js for inserting a \n every 80 chars?
- Next by Date: [Javascript] js for inserting a \n every 80 chars?
- Previous by thread: [Javascript] js for inserting a \n every 80 chars?
- Next by thread: [Javascript] js for inserting a \n every 80 chars?
- Index(es):