开发者

Jquery - Publish and Subscribe?

开发者 https://www.devze.com 2022-12-13 01:52 出处:网络
Is there such a thing as publish and subscribe for use with jquery to send msgs from 1 javascri开发者_如何学JAVApt page to another.. Using the same idea behind ajax publish and subscribe?

Is there such a thing as publish and subscribe for use with jquery to send msgs from 1 javascri开发者_如何学JAVApt page to another.. Using the same idea behind ajax publish and subscribe?

I would like to use the pattern for communication between pages, i have been using a javascript framework lately but recently converted back to jquery and would love to continue using this.

Any ideas where i should start? and which implementation to use if more than 1 exists..

Thanks


jQuery is a simple JS toolkit that makes working with the DOM easier.

What you need is something like strophe. It uses XMPP via BOSH. There is a video, where the creator describes it.

Another option is the Bayeux protocol. There are implementations in Dojo and jQuery.


jQuery is just a library providing set of utility functions. It is not a programming language. It is not Ajax.

Ajax is a design pattern. It is not a programming language. It is not a library.

Ajax publish-subscribe is just a more specific design pattern that uses the Ajax pattern.

There is no reason it can't be implemented using jQuery.


I think you're looking for an implementation of the bayeux protocol written in jquery.

A comet plugin that uses the bayeux protocol can be found here


You are trying to use the observer pattern to synch the UI? I think this should help you

Have a look at the code behind
basically when you click on the check boxes on top the behaviour of the link changes the code is very small I love it

Cheers


Check out http://laharsub.codeplex.com. This is an open source project that provides publish/subscribe capability using HTTP APIs and comes with a jQuery extension that provides usable OM for Ajax applications.

0

精彩评论

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

关注公众号