简体   繁体   English

使用Ajax将外部div加载到iframe中

[英]load external div into iframe using ajax

I'm running into a brick wall and can't get this to function properly. 我遇到了砖墙,无法正常工作。

How can I load the #content div from http://some-cross-domain-site.com/index.php into an IFrame on my site? 如何从http://some-cross-domain-site.com/index.php将#content div加载到我网站上的IFrame中?

Short answer: you can't unless you load the page via a proxy page on your own domain. 简短的答案:除非您通过自己域上的代理页面加载页面,否则您无法这样做。

To stop malicious users from injecting JavaScript that loads viruses and spyware from an unknown domain, modern browsers have built in security that disables cross site scripting (XSS) with a few exceptions. 为了阻止恶意用户注入从未知域加载病毒和间谍软件的JavaScript,现代浏览器内置了安全功能,该功能可以禁用跨站点脚本(XSS),但有一些例外。

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

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