Browse Source

Fix web-socket-js loading issue.

Joel Martin 15 years ago
parent
commit
8fe2c2f915
4 changed files with 5 additions and 2 deletions
  1. 1 1
      README.md
  2. 2 0
      include/web-socket-js/web_socket.js
  3. 1 1
      vnc.html
  4. 1 0
      vnc.js

+ 1 - 1
README.md

@@ -93,7 +93,7 @@ fill. For example:
         <div id='vnc'>Loading</div>
     </body>
     <script src='vnc.js'></script>
-    <script> windows.onload = RFB.load('vnc'); </script>
+    <script> windows.onload = function () { RFB.load('vnc'); }</script>
 
 
 The file `include/plain.css` has a list of stylable elements.

+ 2 - 0
include/web-socket-js/web_socket.js

@@ -302,10 +302,12 @@
     console.error(decodeURIComponent(message));
   }
 
+  /*
   if (window.addEventListener) {
     window.addEventListener("load", WebSocket.__initialize, false);
   } else {
     window.attachEvent("onload", WebSocket.__initialize);
   }
+  */
   
 })();

+ 1 - 1
vnc.html

@@ -11,7 +11,7 @@
 
     <script src="vnc.js"></script>
     <script>
-        window.onload = RFB.load('vnc');
+        window.onload = function () { RFB.load('vnc'); }
     </script>
 
 </html>

+ 1 - 0
vnc.js

@@ -1247,6 +1247,7 @@ load: function (target) {
                     "'file://' URL is incompatible with Adobe Flash");
         } else {
             WebSocket.__swfLocation = "include/web-socket-js/WebSocketMain.swf";
+            WebSocket.__initialize();
             RFB.use_seq = true;
             RFB.updateState('disconnected', 'Disconnected');
         }