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

问题描述:

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?

场景:第一个人(成员)将要注册: p>

p>


第二个人(管理员)将确认该成员的请求: p>

我想自动将会员的请求计为1而不刷新或者什么, 如何让我的网站在两个用户之间更具互动性? p> div>

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.