如何在iframe标记中加载不同的域网站? [英] How do I load different domain web site in iframe tag?
本文介绍了如何在iframe标记中加载不同的域网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图渲染这样的东西。虽然不完全谷歌。
有些人可以指导我为实现这个目标需要做些什么吗?我只是想使用iframe标签从另一个域渲染一个域名页面。
我尝试了什么:
I am trying to render some thing like this. not exactly google though.
Can some body guide me what needs to be done to achieve this? I just want to render one domain page from another domain using iframe tag.
What I have tried:
<iframe src="https://www.google.com">
</iframe>
推荐答案
你不能。 Google服务器不接受任何 CORS(跨源资源共享) [ ^ ]请求。允许这将是一个主要的安全问题。
iframe
标签不对此行为负责,您无能为力,服务器或客户端另外,为了防止这种情况:它是iframe的目标服务器(即谷歌)明确拒绝提供您的请求。
:用适当的替换'google' case :))
You cannot. Google servers will not accept any CORS (Cross-Origin Resource Sharing)[^] request. Allowing that would be a major security issue.
Theiframe
tag is not responsible for this behaviour, there is nothing you can do, server or client-side, to prevent that: it is the target server of the iframe (i.e., google) which explicitly refuses to serve your request.
: replace 'google' by what is appropriate in your case :)
这篇关于如何在iframe标记中加载不同的域网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文