티스토리 뷰
newline 문자 \n 을 미리 escape 문자 포함하여 날아가지 않게 남겨두었다가
jQuery.text() 적용 후 newline으로 변환한다.
띄어쓰기까지 포함하려면 끝에 .wrap('<pre>'); 붙여주면 된다.
$('').html($('#content').html().replace(/\n/g, '\\n')).text().replace(/\\n/g, '\n');
띄어쓰기까지 포함하려면 끝에 .wrap('<pre>'); 붙여주면 된다.
'웹프로그래밍 > js' 카테고리의 다른 글
동적 스크립트 삽입 (0) | 2013.02.07 |
---|---|
Spac Editor IE에서 이미지 삽입시 커서위치 상실 문제 패치 (0) | 2012.05.23 |
IE 8 이하에서 window.opener null undefined 오류시 (0) | 2012.03.13 |
[Sencha Touch] Theme 생성을 위한 Ruby, SASS, Compass (0) | 2012.03.08 |
텍스트 비교 구현 관련 (0) | 2012.03.06 |
댓글
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- git
- Mac
- IE
- centos
- Docker
- ASP
- nginx
- Wordpress
- Android
- nodejs
- 워드프레스
- Prototype
- mssql
- JSON
- 한글
- javascript
- iis
- API
- Linux
- classic asp
- Debug
- CSS
- laravel
- macos
- sencha touch
- PHP
- IOS
- JQuery
- iphone
- 안드로이드
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
글 보관함