댓글 검색 목록

[javascript] 자바 스크립트에서 URL 인코딩 방법

페이지 정보

작성자 운영자 작성일 17-12-23 11:15 조회 1,955 댓글 0

자바 스크립트에서 URL 인코딩 방법

const query = encodeURIComponent('hello world?');

//safe to add to URL
const url = `https://google.com/search?q=${query}`;


출력


https://google.com/search?q=hello%20world%3F


댓글목록 0

등록된 댓글이 없습니다.

웹학교 로고

온라인 코딩학교

코리아뉴스 2001 - , All right reserved.