byjg / jquery-sse Goto Github PK
View Code? Open in Web Editor NEWjQuery Plugin for Server-Sent Events (SSE) EventSource Polyfill
License: MIT License
jQuery Plugin for Server-Sent Events (SSE) EventSource Polyfill
License: MIT License
When you send a contiguous stream of events (instead of calling a script over and over again), only the last one will be triggered. This is not in sync with Firefox/Chrome and not as I expect it.
Hi!
I was having an issue similar to #8 , with the npm package version 0.1.4, but on comparing with master here it seems that it's the 0.1.3 version, could it be there was a mistake in deploy?
Typo? Should event
be e
here?
https://github.com/byjg/jquery-sse/blob/master/jquery.sse.js#L89
// Private Method for Handle EventSource object
function createEventSource(me) {
me.type = 'event';
me.instance = new EventSource(me._url);
me.instance.successCount = 0;
me.instance.onmessage = me._settings.onMessage;
me.instance.onopen = function (e) {
if (me.instance.successCount++ === 0) {
me._settings.onOpen(e);
}
};
me.instance.onerror = function (e) {
if (event.target.readyState === EventSource.CLOSED) { // <--- event should be e?
me._settings.onError(event); // <--- event should be e?
}
};
SCRIPT5007: Unable to set property 'data' of undefined or null reference in jquery.sse.js (156,32)
MCVE:
var sse = $.SSE("test.php", {
onMessage: function() {
sse.stop();
}
});
sse.start();
Update: I think this is related to the fact, that I do send multiple events per script call, not just one.
I am using your library and I need to set some headers to the Event request. How can I do this?
Hello,
I want to know if it supports IE/Edge or not.
Thank you !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.