분류
javascript
자바 스크립트에서 URL 인코딩 방법
본문
자바 스크립트에서 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
- 이전글JavaScript에서 배열의 객체를 필터링하는 방법 17.12.23
- 다음글자바스크립트에서 배열의 항목의 합계를 구하는 방법 17.12.23