Javascript的TCP套接字连接 [英] Javascript TCP socket connection

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

问题描述

基本上,我有发送信息的服务器(在这种情况下的温度数据,每一秒)

Basically, I have a server that sends out info (in this case temperature data, every second)

我想要显示的温度和动态更新在网页上,只有JavaScript的。

I want to have the temperature displayed and dynamically updated on a webpage, with only javascript.

我不能更改服务器反正。它似乎很简单,但我无法找到我所需要的。

I cannot change the server in anyway. It seems simple but I couldn't find what I needed.

推荐答案

您需要做的是让用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的TCP套接字连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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