Code viewer for World: Test Websockets

// default body is margin 0 and padding 0 

  $('body').css( "margin", "20px" );
  $('body').css( "padding", "20px" );

   
document.write ( `

<h1> Websocket server test </h1>
 <button onclick="test();"   class=ab-largenormbutton > Test </button>  
  <div     id="out"> </div>
  
` );


$("#out").html (  "<p> No websocket detected   </p>" ); 

AB.socketStart();
  
 
function test()
{
  if ( AB.socket.connected )    $("#out").html ( "<p style='color:green; font-weight:bold;'> Websocket server up </p>"   ); 
  else                          $("#out").html ( "<p style='color:red;   font-weight:bold;'> No websocket detected </p>" ); 
}