lab.naminsik
  • Javascript, jQuery
  • Reactjs
  • React Native
  • iOS
  • Android
  • AWS
  • Server
  • Html, CSS
  • Php
  • asp .net
  • SQL
  • Word Press
search
keywords
  • Javascript, jQuery 2016‧12‧16

    JS - textarea의 글자들에 엔터값을 br태그로 변환

    DB 데이터를 불러와서 노출하거나 textarea로 부터 입력받은 데이터를 DB에 저장하려 할 때 종종 쓰인다. str = str.replace(/(?:\r\n|\r|\n)/g, '<br />');  str이라는 변수에 textarea에서 입력받은 데이터가 있다면 엔터는 br 태그로 변환된다. 아래는 예제 미리보기이다.

  • Javascript, jQuery 2016‧05‧03

    jQuery - input과 textarea 글자 입력수 제한

    해외에서 공유된 코드이다. 원문 : http://www.scriptiny.com/2012/09/jquery-input-textarea-limiter/ (function($) { $.fn.extend( { limiter: function(limit, elem) { $(this).on("keyup focus", function() { setCount(this, elem); }); function setCount(src, elem) { var chars = src.value.length; if (chars > limit) { src.value = src.value.substr(0, limit); chars = limit; } elem.html( limit - chars ); } setCount($(this)[0], elem); } }); })(jQuery);  이렇게 플러그인으로 […]

popular

  • react, vue - Uncaught SyntaxError: Unexpected token
  • 자바스크립트 새창 뛰우기 옵션과 방법
  • SQL Server 에이전트(에이전트 XPs 사용 안 함) 작동 시키기
  • jQuery - a 태그의 href 값 변경하기
  • ffmpeg 이용해서 HLS 파일 인코딩
  • 포토샵 튜토리얼 사이트
  • JS - datepicker(jQueryUI,달력) 이용시 두개 날짜 범위 설정
  • css - 크롬 position fixed 버그 해결 방법
  • 크롬 브라우저 http 웹사이트에서 위치(지오로케이션) 가져오기 중단
  • .NET - 동적으로 ID값 변경되지 않게 설정

comment

  • 감사합니다!
  • 감사합니다~
  • 잘 해결 되셨다니 다행입니다!...
  • 정말 감사합니다. 덕분에 해결했습니다!...
  • 유용한정보 대단히 감사합니다....