Commit 255e68fbfab3796a63c5b54ea3b8cc12f5115e72

Authored by jsenella
1 parent e04fa0e2

Ajout lecture mode suite à oubli précédent

Showing 1 changed file with 5 additions and 10 deletions   Show diff stats
Application_raspberryJustine/pageHTML/mode.html
@@ -12,17 +12,10 @@ @@ -12,17 +12,10 @@
12 websocket.onerror=function(){ $('h1').css('color','red');}; 12 websocket.onerror=function(){ $('h1').css('color','red');};
13 websocket.onopen=function(){ $('h1').css('color','green');}; 13 websocket.onopen=function(){ $('h1').css('color','green');};
14 14
15 -  
16 - webscket.onmessage=function(message){  
17 - console.log(message.data);  
18 - $('#messages').append($('<p>',{ text: message.data}));  
19 - };  
20 -  
21 - function mode(){  
22 - var message=$('#myonoffswitch').checked;  
23 - websocket.send(message);  
24 - 15 + function sendMessage(){
  16 + websocket.send($('#onoffswitch').is(':checked'));
25 } 17 }
  18 +
26 </script> 19 </script>
27 20
28 </head> 21 </head>
@@ -35,6 +28,8 @@ @@ -35,6 +28,8 @@
35 <span class="onoffswitch-switch"></span> 28 <span class="onoffswitch-switch"></span>
36 </label> 29 </label>
37 </div> 30 </div>
  31 + <button onclick="sendMessage();">Send</button>
  32 + <div id="messages"></div>
38 33
39 <h3><a href="Menu.html">Retour</a></h3> 34 <h3><a href="Menu.html">Retour</a></h3>
40 </body> 35 </body>