Contents

조회 수 7223 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

이렇게 인코딩 해야 됨 ㅋㅋ

<html>

<head>

<script type="text/javascript">
function encode(){
  s = document.f.str.value;
  r = encodeURIComponent(s);
  document.f.res.value = r;
}

function decode(){
  s = document.f.str.value;
  r = decodeURIComponent(s);
  document.f.res.value = r;
}
/*
  var s;

  s = encodeURI('http://www.google.co.kr/소 설.html');
  document.write('<p>' + s + '<p>');
  // 출력 결과: http://www.google.co.kr/%EC%86%8C%20%EC%84%A4.html

  s = encodeURIComponent('http://www.google.co.kr/소 설.html');
  document.write('<p>' + s + '<p>');
  // 출력 결과: http%3A%2F%2Fwww.google.co.kr%2F%EC%86%8C%20%EC%84%A4.html


  s = escape('http://www.google.co.kr/소 설.html');
  document.write('<p>' + s + '<p>');
  // 출력 결과: http%3A//www.google.co.kr/%uC18C%20%uC124.html
*/

</script>

</head>

<body>


<form name=f>
<textarea name=str cols=70 rows=7></textarea>
<br>
<input type=button onClick=encode() value=Encode>
<input type=button onClick=decode() value=Decode>
<br>
<textarea name=res cols=70 rows=7></textarea>
</form>

</body>
</html>


?

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
849 Develop [java] 채팅창 처럼2.. swing.. file hooni 2013.04.23 6423
848 Develop [doc] C언어 문법 설명서 file hooni 2013.04.23 6437
847 Develop [php] 정규표현식 간단히 정리 hooni 2013.04.23 6455
846 Develop [c] 메세지 프로그램 (Server - Agent - Client) file hooni 2013.04.23 6459
845 Develop [js] 윤동이가 만든 영어 학습(?) 프로그램 file hooni 2013.04.23 6462
844 Develop [c] 네트워크 보안 프로그래밍 과제 (Server,Agent,Client) file hooni 2013.04.23 6473
843 Develop [js] 새로고침(refresh)방법과 다른 페이지 바꾸기.. hooni 2003.04.23 6521
842 Develop [c] 민수형 소스(도메인소켓포함) file hooni 2013.04.23 6522
841 Develop [c] 간단한 점 이동 샘플 소스코드 hooni 2013.04.23 6544
840 Develop [c] 웅지학원 NAT를 소스코드로.. file hooni 2013.04.23 6611
839 Develop [c++] 인라인 함수 설명과 예제.. file hooni 2013.04.23 6633
838 Develop [js] 스타크래프트(starcraft).. file hooni 2013.04.23 6641
Board Pagination Prev 1 ... 23 24 25 26 27 28 29 30 31 32 ... 98 Next
/ 98