测试网页代码如下
<!DOCTYPE html> <html> <head> <title>测试 websocket 世界最简单案例</title> </head> <body> <script> var ws = new WebSocket("ws://127.0.0.1:8001/"); ws.onopen = function(){ alert("open"); ws.send("WebSocket"); }; ws.onmessage = function(ev){ alert(ev.data); }; ws.onclose = function(ev){ alert("close"); }; ws.onerror = function(ev){ console.log(ev); alert("error"); }; </script> </body> </html>
如对本文有疑问, 点击进行留言回复!!
rfid档案管理-基于RFID技术的智能档案管理系统—铨顺宏fuwit
基于解决sci和ei等国外期刊论文翻译阅读难等问题的辅助软件分析
网友评论