简体   繁体   English

iframe跨域

[英]iframe cross domain

we have a html page with a iframe in it on our server, the content of that iframe is from another domain. 我们的服务器上有一个带有iframe的html页面,该iframe的内容来自另一个域。 When client side view this html page, they can right click on the iframe to view the sources, but how can we code to access to that code from the outside.. 当客户端查看此html页面时,他们可以右键单击iframe查看源代码,但我们如何编码从外部访问该代码。

You can't spy on the data that your visitors get from other sites. 无法监视访问者从其他网站获取的数据

If you know the URI they are visiting (which is only possible for the initial page specified by the src attribute (because you decide that that is)), then you can make an HTTP request from your server (the specifics of how you do that depends on the technologies available on your server). 如果你知道他们正在访问的URI(这只能用于src属性指定的初始页面(因为你决定那样)),那么你可以从你的服务器发出一个HTTP请求(你如何做到这一点的具体细节)取决于您服务器上可用的技术)。 That will get you the content of the page (but not with the user's credentials). 这将获得页面的内容(但不是用户的凭据)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM