如何在iframe中的两个端口之间发送数据? [英] How to sent Data between two ports in iframe ?
本文介绍了如何在iframe中的两个端口之间发送数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请帮帮我:(
我有一页:www.a.com
我在其中使用了iframe!
但我的iframe地址是:www.a:8585.com
我需要将数据从iframe发送到主页!
i test window.postmessage!但在一个端口上使用shud!
你知道吗?
解决方案
我猜你只能使用postmessage。为什么不使用两个端口?
以下是示例代码:
http://msdn.microsoft.com/en-us/library/ie/ hh772432%28v = vs.85%29.aspx [ ^ ]
Hi !
please help me :(
I have a page on : www.a.com
and i use in it an Iframe !
But my iframe address is : www.a:8585.com
I need to way send data From iframe to main page !
i test window.postmessage ! but shud use on one port !
did U know any way ?
解决方案
I guess you could do with postmessage only. Why don't you use two ports?
Here is the sample code:
http://msdn.microsoft.com/en-us/library/ie/hh772432%28v=vs.85%29.aspx[^]
这篇关于如何在iframe中的两个端口之间发送数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文