摘要: HTML5提供了跨文档消息机制(Cross Document Messaging),它提供了跨越frame、tabs或windows通信的能力。PostMessage API要接收消息的页面需要添加相应的事件监听器,在消息到来时你可以检测其来源来并判断是否处理。浏览器的支持情况:检测浏览器支持:if (typeof window.postMessage === “undefined”) { // postMessage not supported in this browser}发送消息:发送消息给另一个页面:window.postMessage(“Hello, world”, “porta. 阅读全文
posted @ 2012-08-22 15:57 无赖君子 阅读(516) 评论(0) 推荐(0) 编辑