惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 【当耐特】
Help Net Security
Help Net Security
P
Proofpoint News Feed
J
Java Code Geeks
爱范儿
爱范儿
Last Week in AI
Last Week in AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
F
Full Disclosure
Google DeepMind News
Google DeepMind News
H
Help Net Security
G
Google Developers Blog
Jina AI
Jina AI
Vercel News
Vercel News
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
L
Lohrmann on Cybersecurity
S
Schneier on Security
Microsoft Azure Blog
Microsoft Azure Blog
IT之家
IT之家
Security Archives - TechRepublic
Security Archives - TechRepublic
阮一峰的网络日志
阮一峰的网络日志
N
News and Events Feed by Topic
GbyAI
GbyAI
B
Blog
O
OpenAI News
博客园_首页
Cisco Talos Blog
Cisco Talos Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Hacker News: Ask HN
Hacker News: Ask HN
TaoSecurity Blog
TaoSecurity Blog
腾讯CDC
MongoDB | Blog
MongoDB | Blog
M
MIT News - Artificial intelligence
C
Cybersecurity and Infrastructure Security Agency CISA
Cyberwarzone
Cyberwarzone
Webroot Blog
Webroot Blog
Simon Willison's Weblog
Simon Willison's Weblog
Y
Y Combinator Blog
C
Cisco Blogs
A
Arctic Wolf
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
The Exploit Database - CXSecurity.com
Security Latest
Security Latest
AI
AI
W
WeLiveSecurity
aimingoo的专栏
aimingoo的专栏
The Register - Security
The Register - Security
Project Zero
Project Zero
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
Netflix TechBlog - Medium
Blog — PlanetScale
Blog — PlanetScale

博客园 - leonbao

Unity3D - 关于Dynamic和Static Cocos2d-x——支持多触点 Cocos2d-x——Cocos2d-x 屏幕适配总结 Cocos2d-x——Cocos2d-x 屏幕适配新解 – 兼容与扩展【转载】 Cocos2d-x——Cocos2d-x 屏幕适配新解【转载】 Unity3D-Baked Lightmapping 示例学习 Cocos2d-x——CocosBuilder官方帮助文档翻译3 动画 Cocos2d-x——CocosBuilder官方帮助文档翻译2 多分辨率支持 Cocos2d-x——pthread的使用注意事项 人工智能-有限状态机(FSM)的学习 Cocos2d-x——CocosBuilder官方帮助文档翻译1 使用自定义类 高性能服务器-关于游戏服务器中多线程的使用 Unity3D-UnityVS的安装和使用 高性能服务器-多线程的再次学习 Programming Windows Workflow Foundation第六章-工作流宿主翻译完成 关于SQL Server数据库设计的感悟,请指教 关于分层结构的感悟,请指教 NHibernate 连接 Access数据库的配置文件 - leonbao [原创]关于多层设计想到的问题-涉及Nhibernate和Log4Net
HTML5 - HTML5 postMessage API 注意事项
leonbao · 2013-09-09 · via 博客园 - leonbao

一:发送

window.postMessage("Hello, world", "http://127.0.0.1:8080");

注意,必须要加上http://,后面的端口如果是80的话,不必写,就算写了,监听的时候e.origin也不必把端口带上

二:绑定监听事件

window.addEventListener("message", messageHandler, true);

注意,绑定事件的类型是message,而不是load

三:监听

function messageHandler(e){

  switch(e.origin){

    case "http://127.0.0.1:8080":