PageBus 页面交互组件间(web版的“JMS”)
1 head中引入pagebus.js ()
2 接收订阅
(top.)window.PageBus.subscribe('user.add', this, onUserAddedOrUpdated, null) ;//最好将订阅事件放在top里面,免得2个页面中的pagebus对象不是同一个对象,那样会接收不到消息的。
function onUserAddedOrUpdated(subj, msg, data) {
var cId = msg.userId;
alert(cld)
}
3.发布订阅消息
(top.)window.PageBus.publish('user.add',{userId:newId});
下载地址:http://developer.tibco.com/gi/product_resources_pagebus2.jsp?tab=downloads
还有很多个用法,具体参加下载文件中的demo 和api document .