Node Client (2)
来源:互联网 发布:java代理模式的好处 编辑:程序博客网 时间:2024/05/21 22:47
<html><head> <script src="./js/jquery-1.12.3.min.js"></script> <script> var ws = new WebSocket("ws://localhost:13002"); ws.onopen = function(e) { //连接时触发openx(); }; function sendMessage() { // ws.send($('#message').val()); ws.send('hello'); //send data }; function openx(){ $("#statx").val("open server"); };ws.onclose = function(evt) { //通信断开时自动触发 $("#statx").val("close"); }; function exit() { var r = ws.close(); //关闭连接 console.log("退出", r); } ws.onerror = function(evt) { $("#statx").val("error");}; ws.onmessage = function (evt) {//后台返回消息的时候触发 $("#xxx").val(evt.data); }; </script></head><body><form role="form" id="chat_form" onsubmit="sendMessage(); return false;"> <div class="form-group"> <input class="form-control" type="text" name="message" id="message" placeholder="Type text to echo in here" value="" /> </div> <button type="button" id="send" class="btn btn-primary" onclick="sendMessage();"> Send! </button> </form><input type="text" name="xx" id="xxx" value="sss" /><br><br><input type="text" name="statx" id="statx" value="sss" /></body></html>
阅读全文
0 0
- Node Client (2)
- Transport Client vs Node Client
- Node Client code
- ElasticSearch:Transport Client 对比 Node Client
- Transport Client 与 Node Client 官网谈差别
- interrup controller node and interrupt client node
- chef client注册为node
- Zookeeper ACL(使用node-zookeeper-client)
- node client of elastic search笔记
- Node(25) sharing code between client and server
- Building a Redis Sentinel Client for Node.js
- org.elasticsearch.client.transport.NoNodeAvailableException: No node available
- ROS node调用service: ros::service::call/client.call()
- #2 Node
- node-2
- Socket (2) Client
- spring(2) cxf client
- ftp-client-2
- 关于springboot过滤器处理request参数问题
- 2017.10.16 我靠,I 服了 U
- C/C++中extern关键字详解
- programcreek
- SpringBoot进阶之文件上传(单文件上传/多文件上传)
- Node Client (2)
- 加快Android Studio 的编译
- Android屏幕适配
- Python字符串操作之字符串搜索与替换
- Android酷炫实用的开源框架(UI框架)
- linux添加开机启动项、登陆启动项、定时启动项、关机执行项等的方法
- SpringMVC的原理
- 支付--支付宝手机网站支付(WAP)
- 判断python字典中key是否存在的