简体   繁体   English

如何建立与jQuery的长期连接以进行推送通知?

[英]How can I establish a long-lived connection with jQuery for push notification?

I am trying to establish a long lived connection using jQuery. 我正在尝试使用jQuery建立长期连接。 I have a URL in the form of: 我有以下形式的URL:

http://www.sample.com/Notify?sessionId=xxxxxx

Now if I call this URL with the sessionId, it is equivalent to registering for Asynchronous notifications. 现在,如果我使用sessionId调用此URL,则等效于注册异步通知。 I am aware of ajax calls using jQuery but as I understand it, after getting some data, jQuery terminates the connection. 我知道使用jQuery进行ajax调用,但是据我了解,在获取一些数据后,jQuery终止了连接。 Is there a way to make it retain the connection so that the server miht be able to push information? 有没有办法使它保留连接,以便服务器可以推送信息?

看看这个帖子-带jQuery的Bayeux / Comet

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用Apache / PHP / Javascript的长期连接(异步服务器推送)? - Long-lived connections (asynchronous server push) with Apache/PHP/Javascript? Chrome扩展程序的长期消息连接-如何使用回调函数? - Chrome extension long-lived message connection - how to use callback functions? Facebook 图 API 长寿命令牌 - Facebook Graph API Long-Lived Token 在 React Base chrome 扩展中使用长寿命连接时无法获取状态值 - Unable to get state value in when using long-lived connection in react base chrome extension 将短期访问令牌交换为长期有效 - Exchange short-lived access token for long-lived, not working JavaScript最佳实践:如何实现长期存在的应用程序(单页Web应用程序)? - JavaScript Best Practices: How to implement long-lived apps (one-page web apps)? 如何在浏览器中获取JS代码的长期身份提供者令牌 - How to get long-lived indentity provider tokens for JS code in browser Recoil:将长期存在的客户端 object 传递给选择器 - Recoil: Passing a long-lived client object to a selector 如何在localhost上建立与websocket的安全连接? - How can I establish a secure connection to a websocket on localhost? 如何在用户和WebSocket之间建立一个连接? - How can I establish one connection between a user and the WebSocket?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM