web-socket-js icon indicating copy to clipboard operation
web-socket-js copied to clipboard

Line 65 Error in IE8

Open shahraship opened this issue 11 years ago • 5 comments

I tried to load this up in IE8 and I'm getting an error on line 65:

WebSocket.__flash.create(): Object doesn't support this property or method.

WebSocket.__flash seems like a valid object, however the "create" seems to be failing.

I have Flash Player 12 installed. The SWF seems to be loading just fine, however, I see this error upon initialization through JavaScript.

shahraship avatar Mar 04 '14 01:03 shahraship

Hmm I'm not sure why. Can you try "Troubleshooting" section in: https://github.com/gimite/web-socket-js

Especially follow Step 1 and see if you get any other log messages?

I'll try to see if I can reproduce.

gimite avatar Mar 06 '14 04:03 gimite

Especially follow Step 1 and see if you get any other log messages?

I mean the step to put WEB_SOCKET_DEBUG = true. There seems to be two "Step 1" :)

gimite avatar Mar 06 '14 05:03 gimite

I think I understand why that happens now. I look at the sample.html code and it works in the same browser. The main difference between what I have vs. sample.html is that, it uses body onload, which waits for flash to be loaded as well. However, in my application, I'm using requirejs to load this module. Once the module is loaded, I then attempt to connect with socket right away. Seems like flash isn't completely loaded at that time and that is why the above error is thrown.

I'm however not quiet sure about what is the best way to fix this is.

shahraship avatar Mar 06 '14 21:03 shahraship

require(['domReady'], function (domReady) { domReady(function () { //This function is called once the DOM is ready. //It will be safe to query the DOM and manipulate //DOM nodes in this function. }); });

http://requirejs.org/docs/api.html#pageload

reklis avatar Mar 07 '14 14:03 reklis

Sorry I forgot to follow up on this thread. web-socket-js queues actual process until Flash object is ready, so it should work even if you use WebSocket immediately after loading web_socket.js. I verified that it works with IE11. But there may be an issue specific to IE8. It may be safer to wait until onload.

gimite avatar Apr 23 '14 13:04 gimite