This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

EventSource: url 속성

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨2020년 1월⁩.

참고 : 이 기능은 Web Worker에서 사용할 수 있습니다.

EventSource 인터페이스의 url 읽기 전용 속성은 소스의 URL을 나타내는 문자열을 반환합니다.

소스의 URL을 나타내는 문자열.

예제

js
const evtSource = new EventSource("sse.php");
console.log(evtSource.url);

참고 : GitHub 에서 전체 예시를 확인할 수 있습니다. PHP를 사용한 간단한 SSE 데모를 확인하세요.

명세서

Specification
HTML
# dom-eventsource-url-dev

브라우저 호환성

같이 보기