Is SignalR a suitable substitute for jQuery Ajax (or similar)

谁说我不能喝 提交于 2019-12-09 08:23:31

问题


As per title, would SignalR be a suitable substitute for general Ajax (e.g. jQuery Ajax) updates used in web pages.

Thanks


回答1:


If all you need to do is browser-initiated calls to the server triggered by user actions then you should just use jQuery Ajax.

Only use SignalR where the server needs to update the client asynchronously to any user action. Use it in situations where you would traditionally have used a timer and an Ajax call to poll the server repeatedly to see if anything has changed.

In a situation where you have both kinds of call happening you can use SignalR for both the user actions and the server delivered notifications but it may still be easier/cleaner to keep them separate.



来源:https://stackoverflow.com/questions/10654690/is-signalr-a-suitable-substitute-for-jquery-ajax-or-similar

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