Difference between reverse ajax and normal ajax

帅比萌擦擦* 提交于 2019-12-07 15:17:14

问题


Can anybody describe me the difference between reverse ajax and normal ajax . If possible explain what reverse ajax can do in web world , some real world examples too.

I never used this reverse ajax ,is that apt for normal web application?


回答1:


Normal ajax, you need to poll your server from your client periodically.

For reverse ajax, the server pushes update to your client when it has.




回答2:


Reverse Ajax: is essentially a concept: being able to send data from the server to the client. In a standard HTTP Ajax request, data is sent from client to the server.

Other simmilar terms are HTTP Polling, Long Polling, Comet, Server Push, Web Sockets in HTML5.

Comet is a web application model where a request is sent to the server and kept alive for a long time, until a time-out or a server event occurs. When the request is completed, another long-lived Ajax request is sent to wait for other server events. With Comet, web servers can send the data to the client without having to explicitly request it.

Here is an sample demo which I shared on github to show reverse ajax using servlet3.0 async feature https://github.com/uravik21/ReverseAjax-JspTagJspFragment



来源:https://stackoverflow.com/questions/9888418/difference-between-reverse-ajax-and-normal-ajax

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!