Code Monkey home page Code Monkey logo

Comments (7)

rfox90 avatar rfox90 commented on July 17, 2024

Do you see any syntax errors or console.logs in the web console when you have the tools open.

IE8 has issues with javascript.

from web-socket-js.

Metafalica avatar Metafalica commented on July 17, 2024

No any errors seen in log, while I even have WEB_SOCKET_DEBUG = true;
Well, as soon as I turn on log everything starting to work O_o So I can't know if there is any errors in log while log is not shown.

from web-socket-js.

rfox90 avatar rfox90 commented on July 17, 2024

Can you try adding this following code somewhere in your application:

// Avoid `console` errors in browsers that lack a console.
(function() {
    var method;
    var noop = function () {};
    var methods = [
        'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
        'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
        'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
        'timeStamp', 'trace', 'warn'
    ];
    var length = methods.length;
    var console = (window.console = window.console || {});

    while (length--) {
        method = methods[length];

        // Only stub undefined methods.
        if (!console[method]) {
            console[method] = noop;
        }
    }
}());

It stubs undefined methods of the console object. In IE 8 the console only exists when its open as far as i remember.

from web-socket-js.

Metafalica avatar Metafalica commented on July 17, 2024

This is helped O_o Thanks for that!

from web-socket-js.

gimite avatar gimite commented on July 17, 2024

You mean you used console in your own code? web_socket.js should already handle a case where console is missing.

from web-socket-js.

Metafalica avatar Metafalica commented on July 17, 2024

Yes, I had this:

function onMessage(event)
{
    console.log(event.data); //were failing here (on first line), so I though this event never fired
    ...

It comes out that this is totally not your lib issue.

from web-socket-js.

rfox90 avatar rfox90 commented on July 17, 2024

Which is why i asked "Do you see any syntax errors or console.logs in the web console when you have the tools open."

The snippet i provided is pretty good for general catchall solutions to IE8 issues though.

from web-socket-js.

Related Issues (20)

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.