• Skip to main content
  • Skip to search
  • Skip to select language
MDN Logo
    • Technologies Overview
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs
    • Browser Extensions
    • MathML
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
    • Send Feedback
    • Contribute to MDN
    • Report a content issue 🌐
    • Report a platform issue 🌐
  1. Web technology for developers
  2. Web APIs
  3. EventSource
  4. EventSource.url

Table of contents

  • Value
  • Examples
  • Specifications
  • Browser compatibility
  • See also

EventSource.url

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

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
HTML Standard
# dom-eventsource-url-dev

Browser compatibility

See also

  • EventSource

Found a problem with this page?

  • Edit on GitHub
  • Source on GitHub
  • Report a problem with this content on GitHub
  • Want to fix the problem yourself? See our Contribution guide.

Last modified: Mar 24, 2022, by MDN contributors

Related Topics

  1. EventSource
  2. Constructor
    1. EventSource()
  3. Properties
    1. readyState
    2. url
    3. withCredentials
  4. Methods
    1. close()
  5. Events
    1. error
    2. message
    3. open
  6. Inheritance:
    1. EventTarget
MDN Logo
  • Web Technologies
  • Learn Web Development
  • About MDN
  • Feedback
  • About
  • MDN Web Docs Store
  • Contact Us
  • Firefox

MDN

  • MDN on Twitter
  • MDN on Github

Mozilla

  • Mozilla on Twitter
  • Mozilla on Instagram

© 2005-2025 Mozilla and individual contributors. Content is available under these licenses.

  • Terms
  • Privacy
  • Cookies