Просмотр исходного кода

Use current host as base to Websocket Example URL

Eduardo Gurgel 11 лет назад
Родитель
Сommit
f9e76d7df2
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      examples/websocket/priv/index.html

+ 2 - 1
examples/websocket/priv/index.html

@@ -9,6 +9,7 @@
       $(document).ready(init);
       $(document).ready(init);
       
       
       function init() {
       function init() {
+          $('#server').val("ws://" + window.location.host + "/websocket");
           if(!("WebSocket" in window)){  
           if(!("WebSocket" in window)){  
               $('#status').append('<p><span style="color: red;">websockets are not supported </span></p>');
               $('#status').append('<p><span style="color: red;">websockets are not supported </span></p>');
               $("#navigation").hide();  
               $("#navigation").hide();  
@@ -92,7 +93,7 @@
     <div id="navigation">
     <div id="navigation">
 
 
       <p id="connecting">
       <p id="connecting">
-	<input type='text' id="server" value="ws://localhost:8080/websocket"></input>
+	<input type='text' id="server" value=""></input>
 	<button type="button" onclick="toggle_connection()">connection</button>
 	<button type="button" onclick="toggle_connection()">connection</button>
       </p>
       </p>
       <div id="connected">				
       <div id="connected">