dongmen1925 2017-08-02 02:10
浏览 80
已采纳

我如何才能让我的网站在两个用户之间更具互动性?

Scenario: The first person (member) is going to register:

enter image description here


And the second person (admin) will confirm the request of the member: enter image description here

I want to automatically count the request of the member as 1 without refreshing or something, How to make my website more interactive between two users?

  • 写回答

1条回答 默认 最新

  • doutidi5037 2017-08-02 03:04
    关注

    You can run a script that uses ajax to hit a defined url every second and gets the data you need, ou use something quite new and advanced called WebRTC. Of course, you can always use a framework that does it for you, but it's always good to know what's going on under the hood.

    -------- EDIT --------

    You need to use ajax in both pages. In one page, for the user to send the request and store it to the DB, and in the admin page for it to hit every second some URL that returns the number of open requests, so you can load the admin page once and keep hitting this url to know if the number of open requests have changed since you loaded the page. If so, you update the info or do whatever ou need, without refreshing the page.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置