1

Is there such a thing as publish and subscribe for use with jquery to send msgs from 1 javascript 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

4

5 回答 5

2

jQuery 是一个简单的 JS 工具包,可以更轻松地使用 DOM。

你需要的是strophe 之类的东西。它通过BOSH使用XMPP。有一个视频,创建者对其进行了描述。

另一种选择是Bayeux协议。Dojo 和 jQuery 中有实现。

于 2009-12-04T13:43:31.177 回答
0

您正在尝试使用观察者模式来同步 UI?我认为应该可以帮助你

看看后面的代码
基本上当你点击顶部的复选框时链接的行为会改变代码非常小我喜欢它

干杯

于 2009-12-17T10:51:54.023 回答
0

我认为您正在寻找用 jquery 编写的bayeux 协议的实现。

可以在这里找到使用bayeux 协议的comet 插件

于 2009-12-04T13:40:59.590 回答
0

查看http://laharsub.codeplex.com。这是一个开源项目,它使用 HTTP API 提供发布/订阅功能,并附带一个为 Ajax 应用程序提供可用 OM 的 jQuery 扩展。

于 2010-07-13T00:22:03.460 回答
0

jQuery 只是一个提供一组实用函数的库。它不是一种编程语言。它不是阿贾克斯。

Ajax 是一种设计模式。它不是一种编程语言。它不是图书馆。

Ajax 发布-订阅只是一种使用 Ajax 模式的更具体的设计模式。

没有理由不能使用 jQuery 来实现它。

于 2009-12-04T13:37:07.170 回答