Comments (5)
Hmm it works fine with my Safari 4.0.4 on WinXP. I don't have Mac so I cannot debug it further myself... A few questions:
- When it fails? Isn't even "onopen" shown?
- Is Flash Player installed properly in your Safari? What's version of Flash?
- Could you follow "How to debug" section in README.txt and let me know what's shown in JavaScript console (and Flash errors?)
- You can insert console.log to web_socket.js and something equivalent to Flash code to identify which part works properly and which part doesn't.
from web-socket-js.
Ok, so after some investigation, I realized that WebSocket.__initialize() was not being called, due to the fact that I was loading "web_socket.js" after the "onload" event had already fired, and thus
window.addEventListener("load", WebSocket.__initialize, false);
wasn't doing the trick. I ended up calling it manually and it worked fine in Safari.
from web-socket-js.
I see. So do you use some technique to load web_socket.js dynamically, not with static script tag? I'll try to find way to make it work properly in that case too. Thanks.
from web-socket-js.
Precisely, I wasn't using your sample.html
, I was using my own test file that was appending the needed <script> nodes to the head in an onload function. So since onload had already been triggered, the addEventListener is web_socket.js was useless.
On top of that, I've retried the sample.html
(both on a webserver, and from a trusted file:/// URI) with Safari on my Mac and everything works splendidly. Wish I would have tried that first.
As far as trying to fix it somehow, after a quick Google I found this you could try:
var body = document.getElementsByTagName('BODY')[0];
// CONDITION DOES NOT WORK
if(body && body.readyState == 'loaded') {
DoStuffFunction();
} else {
// CODE BELOW WORKS
if (window.addEventListener) {
window.addEventListener('load', DoStuffFunction, false);
} else {
window.attachEvent('onload', DoStuffFunction);
}
}
EDIT: The code above seems like it might only work in IE... I don't know if there's a universal way of checking if the "onload" event has fired.
from web-socket-js.
I see. Thanks for the info.
from web-socket-js.
Related Issues (20)
- policy server file domain match error HOT 2
- Cant make it work even with perl socket policy server HOT 1
- Connection is closed before receiving all messages... HOT 2
- onmessage event doesn't happens when IE8 in normal mode, but works in F12 script debug mode O_o HOT 7
- Confirm the license version HOT 5
- Only variables should be passed by reference HOT 1
- IE9 Unable to connect websocket HOT 4
- Fetching policy file error connecting to wss endpoint HOT 4
- Edge browser support HOT 1
- don't work at ie 8 HOT 3
- ie8 and ie9 APPCRASH HOT 2
- IE8 下 自动关闭 HOT 2
- How to use web-socket-js with typescript? HOT 2
- Error during WebSocket handshake: Unexpected response code: 200 HOT 2
- IE8 can not connect to websocket HOT 2
- Real-time Collaborative editor HOT 1
- Can not open websocket when using https, but normal in http HOT 11
- Ie9 browser problem
- Show preview of html in new tab
- may help me? some one has this problem. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web-socket-js.