JavaScript套接字连接 [英] Javascript socket connection

查看:75
本文介绍了JavaScript套接字连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

服务器通过套接字连接发送信息(在这种情况下,每秒发送一次温度数据).

A server that sends info (in this case temperature data, every second) through a socket connection which can be listened to.

目标是显示温度并使用javascript动态更新网页上的值.

The goal being to display temperature and dynamically update the value on a webpage, with javascript.

无法修改服务器.

推荐答案

您需要做的是与PHP或其他服务器端建立连接,然后通过AJAX将结果返回到JavaScript.

What you need to do is make the connection with PHP, or something else server side, and return the result via AJAX to your JavaScript.

这篇关于JavaScript套接字连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆