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/j开发者_开发技巧avascript"> 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?
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.
精彩评论