简体   繁体   English

如何使用Javascript在Web服务器上获取JSON文件的更新版本

[英]How to get updated version of JSON file on web server with Javascript

I'm getting data from a form filled in by users. 我从用户填写的表单中获取数据。 I'm using Javascript and XMLHttpRequest to fill in the data on another form. 我正在使用Javascript和XMLHttpRequest填写另一种形式的数据。 My issue is that when the user enters their data, the JSON file on my server updates accordingly but it takes time to show on the main page, how do I force javascript to always get the most updated version of my file quickly ? 我的问题是,当用户输入数据时,服务器上的JSON文件会相应更新,但是要花时间显示在主页上,如何强制javascript始终快速获取文件的最新版本?

如果可能,将应用程序切换到WebSocket- https://github.com/websockets/ws

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM