Web/API/EventSource/url

From Get docs


The url read-only property of the EventSource interface returns a DOMString representing the URL of the source.

Syntax

var myUrl = eventSource.url;

Value

A DOMString representing the URL of the source.

Examples

var evtSource = new EventSource('sse.php');
console.log(evtSource.url);

Note: You can find a full example on GitHub — see Simple SSE demo using PHP.


Specifications

Specification Status Comment
HTML Living StandardThe definition of 'url' in that specification. Living Standard Initial definition


Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
url Chrome

Full support 6

Edge

Full support 79

Firefox

Full support 6

IE

No support No

Opera

Full support Yes

Safari

Full support 5

WebView Android

Full support Yes

Chrome Android

Full support 18

Firefox Android

Full support 45

Opera Android

Full support 12

Safari iOS

Full support 5

Samsung Internet Android

Full support 1.0

Legend

Full support  
Full support
No support  
No support


See also