http 服务器推送以触发操作
我正在尝试实现服务器推送,其中可以根据服务器中经过的时间间隔触发某些操作。我想这样做,因为我不必关心 javascript 计时器、浏览器依赖性、用户禁用 javascript。 我尝试了 CGI::Push,但我不确定如何使用它触发事件。假设我想根据从服务器收到的某些响应提交表单。 如果有更好的方法来启动时间控制事件,我正在寻找它们。
I am trying to implement server push where in some action can be triggered based on a time interval elapsed in the server. I thought of doing it this way as I do not have to take care of the javascript timer , browser dependency, users disabling javascript.
I tried CGI::Push, but I am not sure how can i trigger an event using it. Say If I want to submit the form based on some response received from server.
If there is some better way to initiate time controlled events, I am looking for them.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有几种方法可以让浏览器执行操作:
但是,据我所知,只有前两种(用户活动和客户端 javascript)可以提交表单,只有javascript可以自动与服务器交互。因此,如果用户禁用了 javascript,您就无法让他们的浏览器执行某些操作——这就是人们首先禁用 javascript 的原因。
There are a few ways to make a browser perform an action:
However, as far as I'm aware only the first two (user activity and client-side javascript) can submit a form, and only javascript can interact with the server automatically. So if the user has javascript disabled, you can't make their browser do something -- which is kind of the reason why people disable javascript in the first place.