跨域文件(接收器)如何工作?
那么,它是如何运作的呢?为什么receiver.html可以允许跨域通信?我……只是……不明白。
例如(以 Heyzap 为例)
<script type="text/javascript" src="http://tools.heyzap.com/external/tools/v4.js"></script> <script type="text/javascript"> HeyzapTools.load({
game_key: "your-game-key-here",
hz_receiver_url: "http://example.com/hz_receiver.html" });
</script>
,hz_receiver.html 有这样的内容:
<html>
<body>
<script src="/external/tools/hz_receiver.js" type="text/javascript"></script>
</body>
</html>
那么,为什么它会允许跨域呢?
So, how does it work? How come having a receiver.html can allow cross domain communication? I... just... don't understand.
For example, (using Heyzap as example)
<script type="text/javascript" src="http://tools.heyzap.com/external/tools/v4.js"></script> <script type="text/javascript"> HeyzapTools.load({
game_key: "your-game-key-here",
hz_receiver_url: "http://example.com/hz_receiver.html" });
</script>
and the hz_receiver.html has this content:
<html>
<body>
<script src="/external/tools/hz_receiver.js" type="text/javascript"></script>
</body>
</html>
so, why it will allow cross domain?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过一天的研究,我发现这是一种处理跨域通信的方法。
http://msdn.microsoft.com/en-us/library/bb735305.aspx
可能receiver.html内的js有一个iframe..使用相同的概念来处理跨域。
After a day of research, I find out it is a way to deal with cross domain communication.
http://msdn.microsoft.com/en-us/library/bb735305.aspx
probably the js inside the receiver.html has a iframe.. using same concept to deal with the cross domain.