监听WebSocket连接打开事件。
示例代码:
wx.connectSocket({ url: 'test.php' }) wx.onSocketOpen(function (res) { console.log('WebSocket连接已打开!') })
监听WebSocket连接打开事件。
示例代码:
wx.connectSocket({ url: 'test.php' }) wx.onSocketOpen(function (res) { console.log('WebSocket连接已打开!') })