获取跨域iFrame内容 [英] Get Cross-Domain iFrame content
本文介绍了获取跨域iFrame内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道如何从IFrame跨域获取内容?
I would like to know how I can get content from an IFrame cross-domain?
我从非跨域iFrame获取内容没有问题,但当它位于另一个域时,JavaScript不允许访问。
I have no problem getting content from a non-cross-domain iFrame, but when it's located on another domain, JavaScript doesn't allow access.
推荐答案
没有自己通过代理请求它服务器,你不能。
Short of requesting it via a proxy on your own server, you can't.
同源政策阻止它(并且有充分理由;如果您在我的iframe中加载我的银行网站并阅读我的所有帐户详细信息,我会非常不满意)
The same origin policy prevents it (and for good reason; I would be very unhappy if you loaded my banking site in your iframe and read all my account details)
这篇关于获取跨域iFrame内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文