简体   繁体   中英

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

I am trying to establish a long lived connection using jQuery. I have a URL in the form of:

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

Now if I call this URL with the sessionId, it is equivalent to registering for Asynchronous notifications. I am aware of ajax calls using jQuery but as I understand it, after getting some data, jQuery terminates the connection. Is there a way to make it retain the connection so that the server miht be able to push information?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM