1. <strong id="7actg"></strong>
    2. <table id="7actg"></table>

    3. <address id="7actg"></address>
      <address id="7actg"></address>
      1. <object id="7actg"><tt id="7actg"></tt></object>

        jSocketJavaScript的Socket通訊包

        聯(lián)合創(chuàng)作 · 2023-09-22 17:27

        jSocket 是 JavaScript 實(shí)現(xiàn) Socket 通訊的解決方案。

        示例代碼:

        <script type='text/javascript'>
               
        // Host we are connecting to
               
        var host = 'localhost';
               
        // Port we are connecting on
               
        var port = 3000;
               
               
        var socket = new jSocket();
               
               
        // When the socket is added the to document
                socket
        .onReady = function(){
                        socket
        .connect(host,port);              
               
        }
               
               
        // Connection attempt finished
                socket
        .onConnect = function(success){
                       
        if(success){
                               
        // Send something to the socket
                                socket
        .send('Hello world');            
                       
        }else{
                                alert
        ('Connection to the server could not be estabilished');            
                       
        }      
               
        }
                socket
        .onData = function(data){
                        alert
        ('Received from socket: '+data);  
               
        }
               
               
        // Setup our socket in the div with the id="socket"
                socket
        .setup('#socket');        
         
        </script>
        瀏覽 21
        點(diǎn)贊
        評(píng)論
        收藏
        分享

        手機(jī)掃一掃分享

        編輯 分享
        舉報(bào)
        評(píng)論
        圖片
        表情
        推薦
        點(diǎn)贊
        評(píng)論
        收藏
        分享

        手機(jī)掃一掃分享

        編輯 分享
        舉報(bào)
        1. <strong id="7actg"></strong>
        2. <table id="7actg"></table>

        3. <address id="7actg"></address>
          <address id="7actg"></address>
          1. <object id="7actg"><tt id="7actg"></tt></object>
            欧美老妇婆性XXXXHD4 | 欧美乱伦小说 视频 图片 | 大香蕉论坛伊人在线网 | 外国做爰猛烈床戏 | 日韩1234 | 卧底受呻吟两腿合不拢bl | 日日骚网站 | 51妺妺嘿嘿午夜成人A片 | 天天干天天曰 | 又黄又爽一区二区三区 |