简体   繁体   English

在外部iframe中使用ajax

[英]Using ajax inside an iframe that's external

I've been looking around everywhere and haven't gotten a concrete answer. 我到处环顾四周,还没有得到确切的答案。 Here's the problem: 这是问题所在:

Let's say someone has site abc.com and they want to load my page at xyz.com into an iframe. 假设某人拥有网站abc.com,并且他们希望将xyz.com上的我的网页加载到iframe中。 My page at xyz.com relies heavily on ajax, pulling more content content from xyz.com, the same domain. 我在xyz.com上的页面严重依赖ajax,从同一个域xyz.com提取了更多内容。 Also, the iframe is optimally created on the fly with js, but doesn't have to be. 另外,iframe是使用js动态创建的,但并非必须如此。

Is this a possible to do without a proxy or anything difficult on abc.com? 在没有代理服务器或abc.com上没有任何困难的情况下,这可能吗? I know that cross-domain things can be tricky, but I've never messed with iFrames. 我知道跨域的事情可能很棘手,但我从来没有把iFrame弄乱过。 Willing to do whatever's necessary to my site, xyz.com. 愿意为我的网站xyz.com做任何必要的事情。

Thanks a bunch for any insight. 感谢您的任何见解。

The answer is yes, it works well in all browsers > ie6. 答案是肯定的,它在所有浏览器> ie6中都可以正常工作。 As long as the site inside of the iframe is calling resources from its own domain, the rules are the same as what happens within a normal page (that's not iframed). 只要iframe内的网站从其自己的域中调用资源,规则就与普通页面(不会被iframed)中发生的规则相同。

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

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