Giter VIP home page Giter VIP logo

jquery-sse's Issues

Only last event will be triggered in Edge/IE

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.

npm package 0.1.4 wrong version?

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?

Incorrect variable name in onerror() in createEventSource()

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?
            }
        };

Unable to set property data in Edge/IE

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.