URL.toJSON()
URL
인터페이스의 toJSON()
메서드는 URL을 직렬화한 USVString
을 반환합니다. 그러나, 사실상 toString()
과 같습니다..
참고: 이 기능은 Web Worker에서 사용할 수 있습니다
구문
const href = url.toJSON()
반환 값
예제
const url = new URL("https://developer.mozilla.org/en-US/docs/Web/API/URL/toString");
url.toJSON(); // should return the URL as a string
명세
Specification |
---|
URL Standard # dom-url-tojson |
브라우저 호환성
BCD tables only load in the browser