eventsource
eventsource copied to clipboard
Event.target is undefined when the EventListener dispatched.
hi
I want to refer to the object to which the event is dispatched. However, when I access the Target property of the event, it is undefined. What should I do?
ref: https://developer.mozilla.org/ja/docs/Web/API/Event/target
node.js is used as a client. Since I will be communicating with multiple directories on the same server, I will add a property to the EventSource object for directory identification. Therefore, I need a reference to the target. URL information alone is fine for determining the directory, but the parameter "origin" in the event object contains only the host name and port number and cannot determine the directory.