开发者

http server push to trigger an action

开发者 https://www.devze.com 2023-03-09 04:55 出处:网络
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 javascrip

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.


There are a few ways to make a browser perform an action:

  • User activity
  • Client-side javascript
  • HTTP 301 redirection
  • HTML meta refresh/redirection

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消