Closed Metafalica closed 8 years ago
Do you see any syntax errors or console.logs in the web console when you have the tools open.
IE8 has issues with javascript.
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.
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.
This is helped O_o Thanks for that!
You mean you used console in your own code? web_socket.js should already handle a case where console is missing.
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.
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.
No script debug mode: IE8 can send messages through websocket to server. IE8 does not receive any messages from server
If I press F12 and enable script debugging everything starting to work fine. WTF?!