일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- jQuery
- Rocky
- 알뜰폰
- 킹북이초월
- 스톤에이지
- OpenWrt
- 램가스초월
- iptime
- 티스토리
- 윈도우10
- 소비전력
- 가상서버호스팅
- 라즈베리파이2
- 시놀로지
- 자바스크립트
- mysql
- centos
- 아파치
- KB증권
- KB국민카드
- proxmox
- PHP-FPM
- SKT
- php
- 보르비스초월
- Apache
- 리눅스
- 알리익스프레스
- ConoHa
- 복현오거리
- Today
- Total
맛집 여행 캠핑 일상 생활
자바스크립트 URI Encode Decode 본문
728x90
자바스크립트 URI Encode Decode
URL 에 보면 한글문자나 특수문자 같은 경우는 URI 인코딩을 해서 전달합니다.
JAVASCRIPT 로 URI Encode 및 Decode 하는 방법입니다.
<script>
function myEncode() {
var str = document.getElementById("intext").value;
var ret = encodeURIComponent(str);
document.getElementById("result").value = ret;
}
function myDecode() {
var str = document.getElementById("intext").value;
var ret = decodeURIComponent(str);
document.getElementById("result").value = ret;
}
</script>
<input type="text" id="intext" value="">
<br>
<br>
<button onclick="myEncode()">URL Encode</button>
<button onclick="myDecode()">URL Decode</button>
<br>
<br>
<input type="text" id="result" value="">
728x90
반응형
'JAVASCRIPT' 카테고리의 다른 글
JAVASCRIPT window.open POST 로 값 전달하기 (0) | 2017.05.24 |
---|---|
자바스크립트 프린터 출력 이벤트 알아내기 (0) | 2017.04.19 |
JAVSCRIPT PHP 사업자등록번호 체크 방법 (0) | 2016.11.04 |
JAVASCRIPT location 도메인 및 포트, URL 정보 오브젝트 (0) | 2016.10.28 |
JAVASCRIPT window message 전달 (0) | 2016.10.28 |
Trackback : | Comments :