Skip to content Skip to sidebar Skip to footer

Html5 Server-sent Events: How To Set Withcredentials Option?

According to WHATWG - Server-Sent Events below is the API for using EventSource interface: [Constructor(DOMString url, optional EventSourceInit eventSourceInitDict)] interface Even

Solution 1:

I've not tried it, but going by the spec you link to, I believe it would be like this:

var stocks = new EventSource("events.php", { withCredentials: true });

If you go to http://www.w3.org/TR/WebIDL/#idl-exceptions then scroll up to see the example immediately above that, you can see a similar pattern of using a dictionary to set initialization values.

Post a Comment for "Html5 Server-sent Events: How To Set Withcredentials Option?"